summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2018-02-19 15:41:30 +0100
committerEdward Hervey <bilboed@bilboed.com>2018-02-27 08:22:30 +0100
commit31fcd8f14da837dcc773d7c61aed3753d9e818a4 (patch)
tree1557bb5a14509cba9ca03ab409db426bac67ed8d
parentafd056f17c2064125ad1e2df4a3fd9bb66fd9aa8 (diff)
fixups WIP anc/vbi
-rw-r--r--gst-libs/gst/video/video-anc.h13
-rw-r--r--gst-libs/gst/video/video-vbi.c5
2 files changed, 11 insertions, 7 deletions
diff --git a/gst-libs/gst/video/video-anc.h b/gst-libs/gst/video/video-anc.h
index 40bd348e8..efb5b1691 100644
--- a/gst-libs/gst/video/video-anc.h
+++ b/gst-libs/gst/video/video-anc.h
@@ -32,17 +32,18 @@ typedef struct _GstVideoAncillary GstVideoAncillary;
* @SDID_block_number: The Secondary Data Identifier (if type 2) or the Data
* Block Number (if type 2)
* @data_count: The amount of data (in bytes) in @data (max 255 bytes)
- * @data: The content of the Ancillary packet in 16bit. Contains everything
- * including the ADF, DID, SDI, DC, user words and CS. (the size
- * is therefore @data_count + 4)
+ * @data: The user data content of the Ancillary packet. Does not contain
+ * the ADF, DID, SDID nor CS.
*
- * Video Ancillary data, according to SMPTE-291M specification.
+ * Video Ancillary data, according to SMPTE-291M specification. The contents
+ * of the data are always stored as 8bit data (i.e. do not contain the parity
+ * check bits). Use the helper tools to convert to/from 10bit contents.
* */
struct _GstVideoAncillary {
guint8 DID;
guint8 SDID_block_number;
guint8 data_count;
- const guint16 *data;
+ guint8 *data;
/*< private >*/
/* Padding for future extension */
@@ -64,7 +65,7 @@ typedef enum {
GST_VIDEO_ANCILLARY_DID_HANC_SDTV_AUDIO_DATA_2_LAST = 0xff,
} GstVideoAncillaryDID;
-#define GST_VIDEO_ANCILLARY_DID16(anc) ((guint16)(anc->DID) << 8 | (guint16)(anc->SDID_block_number)
+#define GST_VIDEO_ANCILLARY_DID16(anc) ((guint16)((anc)->DID) << 8 | (guint16)((anc)->SDID_block_number))
typedef enum {
GST_VIDEO_ANCILLARY_DID16_S334_EIA_708 = 0x6101,
diff --git a/gst-libs/gst/video/video-vbi.c b/gst-libs/gst/video/video-vbi.c
index 59bae579e..727261b07 100644
--- a/gst-libs/gst/video/video-vbi.c
+++ b/gst-libs/gst/video/video-vbi.c
@@ -68,6 +68,7 @@ gst_video_vbi_parser_get_ancillary (GstVideoVBIParser * parser,
while (parser->offset < parser->work_data_size + SMALLEST_ANC_SIZE) {
guint8 DID, SDID, DC;
+ guint i;
/* Look for ADF
* FIXME : This assumes 10bit data with parity ! */
@@ -93,7 +94,9 @@ gst_video_vbi_parser_get_ancillary (GstVideoVBIParser * parser,
anc->DID = DID;
anc->SDID_block_number = SDID;
anc->data_count = DC;
- anc->data = parser->work_data + parser->offset + 6;
+ anc->data = g_malloc0 (anc->data_count);
+ for (i = 0; i < anc->data_count; i++)
+ anc->data[i] = parser->work_data[parser->offset + 6 + i] & 0xff;
found = TRUE;
parser->offset += SMALLEST_ANC_SIZE + DC;
break;