diff --git a/src/gstducativc1dec.c b/src/gstducativc1dec.c
index d8858c9eb74b837f865a342cc23292fbd0106c8f..041b616e4e0379834df24f2e7d29885b7173357c 100644 (file)
--- a/src/gstducativc1dec.c
+++ b/src/gstducativc1dec.c
"wmvversion = (int) 3, "
"format = (fourcc){ WVC1, WMV3 }, "
"width = (int)[ 16, 2048 ], "
- "height = (int)[ 16, 2048 ], "
- "framerate = (fraction)[ 0, max ];")
+ "height = (int)[ 16, 2048 ], " "framerate = (fraction)[ 0, max ];")
);
/* GstDucatiVidDec vmethod implementations */
params->frameLayerDataPresentFlag = FALSE;
/* enable concealment */
- params->ErrorConcealmentON = 1;
+ params->errorConcealmentON = 1;
/* codec wants lateAcquireArg = -1 */
self->dynParams->lateAcquireArg = -1;
self->first_ts = GST_BUFFER_TIMESTAMP (buf);
if (G_UNLIKELY (vdec->first_in_buffer) && vdec->codec_data) {
+ if (GST_BUFFER_SIZE (vdec->codec_data) > 0) {
+ unsigned char *header = GST_BUFFER_DATA (vdec->codec_data);
+
+ /* There is at least one VC1 stream that claims it is simple profile,
+ but goes on to have frames that use some feature that is unavailable
+ in simple profile(intensity compensation). Since ducati supports
+ both, we frob the header to claim all simple profile videos are
+ main profile. This is a lie, but it should not cause any trouble
+ (I'm sure all liars must say that). */
+ if (!(header[0] & 192))
+ header[0] |= 64;
+ }
+
if (self->level == 4) {
/* for VC-1 Advanced Profile, strip off first byte, and
* send rest of codec_data unmodified;
*/
val = 0xc5ffffff; /* we don't know the number of frames */
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
/* STRUCT_C (preceded by length).. see Table 263, 264 */
val = 0x00000004;
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
val = GST_READ_UINT32_LE (GST_BUFFER_DATA (vdec->codec_data));
/* FIXME: i have NO idea why asfdemux gives me something I need to patch... */
val |= 0x01 << 24;
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
/* STRUCT_A.. see Table 260 and Annex J.2 */
val = vdec->height;
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
val = vdec->width;
- push_input (vdec, (const guint8 *) & val, 4);
- GST_INFO_OBJECT (vdec, "seq hdr resolution: %dx%d", vdec->width, vdec->height);
+ push_input (vdec, (const guint8 *) &val, 4);
+ GST_INFO_OBJECT (vdec, "seq hdr resolution: %dx%d", vdec->width,
+ vdec->height);
val = 0x0000000c;
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
/* STRUCT_B.. see Table 261, 262 */
val = 0x00000000; /* not sure how to populate, but codec ignores anyways */
- push_input (vdec, (const guint8 *) & val, 4);
- push_input (vdec, (const guint8 *) & val, 4);
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
}
}
/* VC-1 Advanced profile needs start-code prepended: */
if (self->level == 4) {
- static const guint8 sc[] = { 0x00, 0x00, 0x01, 0x0d }; /* start code */
+ static const guint8 sc[] = { 0x00, 0x00, 0x01, 0x0d }; /* start code */
push_input (vdec, sc, sizeof (sc));
}
-
+
if (params->frameLayerDataPresentFlag) {
val = GST_BUFFER_SIZE (buf);
if (!GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT))
val |= 0x80 << 24;
else
val |= 0x00 << 24;
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
val = GST_TIME_AS_MSECONDS (GST_BUFFER_TIMESTAMP (buf) - self->first_ts);
- push_input (vdec, (const guint8 *) & val, 4);
+ push_input (vdec, (const guint8 *) &val, 4);
}
/* GstElement vmethod implementations */
static GstStateChangeReturn
-gst_ducati_vc1dec_change_state (GstElement * element,
- GstStateChange transition)
+gst_ducati_vc1dec_change_state (GstElement * element, GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstDucatiVC1Dec *self = GST_DUCATIVC1DEC (element);
GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_change_state);
bclass->codec_name = "ivahd_vc1vdec";
- bclass->parse_caps =
- GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_parse_caps);
+ bclass->parse_caps = GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_parse_caps);
bclass->update_buffer_size =
GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_update_buffer_size);
bclass->allocate_params =
GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_allocate_params);
- bclass->push_input =
- GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_push_input);
+ bclass->push_input = GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_push_input);
bclass->handle_error = GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_handle_error);
bclass->can_drop_frame = GST_DEBUG_FUNCPTR (gst_ducati_vc1dec_can_drop_frame);
}
static void
-gst_ducati_vc1dec_init (GstDucatiVC1Dec * self,
- GstDucatiVC1DecClass * gclass)
+gst_ducati_vc1dec_init (GstDucatiVC1Dec * self, GstDucatiVC1DecClass * gclass)
{
GstDucatiVidDec *vdec = GST_DUCATIVIDDEC (self);