summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@gmail.com>2010-09-28 10:54:51 +0800
committerAustin Yuan <shengquan.yuan@gmail.com>2010-09-28 10:54:51 +0800
commitaa0f007b194a5cbadd6e356f86dcf940bf5eca9f (patch)
tree81947406bf3bf88c015e8acd1b9b14ab742781c5
parentae925aa9a1d03574ab1bfd12e5c542d101d99f1d (diff)
downloadlibva-aa0f007b194a5cbadd6e356f86dcf940bf5eca9f.tar.gz
Squashed commit of the following:
commit 020f37a6a98e4ae106a25015c4dafb39aeed9df3 Author: Austin Yuan <shengquan.yuan@gmail.com> Date: Tue Sep 28 10:50:40 2010 +0800 Added H264_LAST_PICTURE_EOSEQ/EOSTREAM Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com> commit 75f0717bb12aa3adb30fefbe068fcb88192d6578 Author: Austin Yuan <shengquan.yuan@gmail.com> Date: Tue Sep 28 10:44:08 2010 +0800 Update with some comments Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com> commit b3c8b81cb44e3c1fdbb9501174a1dbdc6bfc4480 Author: Binglin Chen <binglin.chen@intel.com> Date: Tue Sep 28 07:40:19 2010 +0800 Fixed mis spell errors commit 1c44736958c3171bee8c1eb66203bc2c3248ad56 Author: Austin Yuan <shengquan.yuan@gmail.com> Date: Mon Sep 27 14:35:49 2010 +0800 Add data structure for Cisco Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com> Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
-rw-r--r--va/va.h102
1 files changed, 95 insertions, 7 deletions
diff --git a/va/va.h b/va/va.h
index 0f12dfb..1f6ee08 100644
--- a/va/va.h
+++ b/va/va.h
@@ -135,6 +135,8 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_TOP_FIELD 0x00000001
#define VA_BOTTOM_FIELD 0x00000002
+#define VA_ENBLE_BLEND 0x00000004 /* video area blend with the constant color */
+
/*
* Clears the drawable with background color.
* for hardware overlay based implementation this flag
@@ -273,6 +275,7 @@ typedef struct _VAConfigAttrib {
#define VA_RC_NONE 0x00000001
#define VA_RC_CBR 0x00000002
#define VA_RC_VBR 0x00000004
+#define VA_RC_VCM 0x00000008 /* video conference mode */
/*
* if an attribute is not applicable for a given
@@ -502,8 +505,68 @@ typedef enum
VAEncSliceParameterBufferType = 24,
VAEncH264VUIBufferType = 25,
VAEncH264SEIBufferType = 26,
+ VAEncMiscParameterBufferType = 27
} VABufferType;
+typedef enum
+{
+ VAEncMiscParameterTypeFrameRate = 0,
+ VAEncMiscParameterTypeBitRate = 1,
+ VAEncMiscParameterTypeMaxSliceSize = 2,
+ VAEncMiscParameterTypeAIR = 3,
+} VAEncMiscParameterType;
+
+/*
+ * For application, e.g. set a new bitrate
+ * VABufferID buf_id;
+ * VAEncMiscParameterBuffer *misc_param;
+ * VAEncMiscParameterBitRate *misc_bitrate;
+ *
+ * vaCreateBuffer(dpy, context, VAEncMiscParameterBufferType,
+ * sizeof(VAEncMiscParameterBuffer) + sizeof(VAEncMiscParameterBitRate),
+ * 1, NULL, &buf_id);
+ *
+ * vaMapBuffer(dpy,buf_id,(void **)&misc_param);
+ * misc_param->type = VAEncMiscParameterTypeAIR;
+ * misc_bitrate = (VAEncMiscParameterBitRate *)misc_param->data;
+ * misc_bitrate->bitrate = 6400000;
+ *
+ * vaRenderPicture(dpy, context, &buf_id, 1);
+ */
+typedef struct _VAEncMiscParameterBuffer
+{
+ VAEncMiscParameterType type;
+ unsigned int data[0];
+} VAEncMiscParameterBuffer;
+
+
+typedef struct _VAEncMiscParameterBitRate
+{
+ unsigned int bitrate;
+} VAEncMiscParameterBitRate;
+
+typedef struct _VAEncMiscParameterFrameRate
+{
+ unsigned int framerate;
+} VAEncMiscParameterFrameRate;
+
+/*
+ * Allow a maximum slice size to be specified (in bits).
+ * The encoder will attempt to make sure that individual slices do not exceed this size
+ * Or to signal applicate if the slice size exceed this size, see "status" of VACodedBufferSegment
+ */
+typedef struct _VAEncMiscParameterMaxSliceSize
+{
+ unsigned int max_slice_size;
+} VAEncMiscParameterMaxSliceSize;
+
+typedef struct _VAEncMiscParameterAIR
+{
+ unsigned int air_num_mbs;
+ unsigned int air_threshold;
+ unsigned int air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
+} VAEncMiscParameterAIR;
+
/*
* There will be cases where the bitstream buffer will not have enough room to hold
@@ -1115,6 +1178,8 @@ typedef struct _VAEncSequenceParameterBufferH264
unsigned char vui_flag;
} VAEncSequenceParameterBufferH264;
+#define H264_LAST_PICTURE_EOSEQ 0x01 /* the last picture in the sequence */
+#define H264_LAST_PICTURE_EOSTREAM 0x02 /* the last picture in the stream */
typedef struct _VAEncPictureParameterBufferH264
{
VASurfaceID reference_picture;
@@ -1122,9 +1187,7 @@ typedef struct _VAEncPictureParameterBufferH264
VABufferID coded_buf;
unsigned short picture_width;
unsigned short picture_height;
- unsigned char last_picture; /* if set to 1 it indicates the last picture in the sequence
- * if set to 2 it indicates the last picture of the stream
- */
+ unsigned char last_picture;
} VAEncPictureParameterBufferH264;
/****************************
@@ -1225,9 +1288,26 @@ VAStatus vaBufferSetNumElements (
/*
* device independent data structure for codedbuffer
*/
-typedef struct _VACodedBufferSegment {
- unsigned int size; /* size of the data buffer in the coded buffer segment, in bytes */
- unsigned int bit_offset;/* bit offset into the data buffer where valid bitstream data begins */
+
+/*
+ * FICTURE_AVE_QP(bit7-0): The average Qp value used during this frame
+ * LARGE_SLICE(bit8):At least one slice in the current frame was large
+ * enough for the encoder to attempt to limit its size.
+ * SLICE_OVERFLOW(bit9): At least one slice in the current frame has
+ * exceeded the maximum slice size specified.
+ */
+#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff
+#define VA_CODED_BUF_STATUS_LARGE_SLICE_MASK 0x100
+#define VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK 0x200
+
+/*
+ * device independent data structure for codedbuffer
+ */
+typedef struct _VACodedBufferSegment {
+ unsigned int size;/* size of the data buffer in the coded buffer segment, in bytes */
+ unsigned int bit_offset; /* bit offset into the data buffer where valid bitstream data begins */
+ unsigned int status; /* status set by the driver on the coded buffer*/
+ unsigned int reserved; /* for future use */
void *buf; /* pointer to the beginning of the data buffer in the coded buffer segment */
void *next; /* pointer to the next VACodedBufferSegment */
} VACodedBufferSegment;
@@ -1739,7 +1819,15 @@ typedef enum
* For type VADisplayAttribCSCMatrix, "value" field is a pointer to the color
* conversion matrix. Each element in the matrix is float-point
*/
- VADisplayAttribCSCMatrix = 12
+ VADisplayAttribCSCMatrix = 12,
+ /* specify the constant color used to blend with video surface
+ * Cd = Cv*Cc*Ac + Cb *(1 - Ac) C means the constant RGB
+ * d: the final color to overwrite into the frame buffer
+ * v: decoded video after color conversion,
+ * c: video color specified by setTextureStreamVideoColor
+ * b: background color of the drawable
+ */
+ VADisplayAttribBlendColor = 13,
} VADisplayAttribType;
/* flags for VADisplayAttribute */