mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-06 02:32:23 +00:00
Fix up small issues (fixes #119036)
Original commit message from CVS: Fix up small issues (fixes #119036)
This commit is contained in:
parent
712da782c9
commit
e74a44ae76
1 changed files with 17 additions and 9 deletions
|
@ -160,10 +160,10 @@ mp1videoparse_parse_seq (Mp1VideoParse *mp1videoparse, GstBuffer *buf)
|
||||||
50., 60./1.001, 60. };
|
50., 60./1.001, 60. };
|
||||||
guint32 n = GUINT32_FROM_BE (*(guint32 *) GST_BUFFER_DATA (buf));
|
guint32 n = GUINT32_FROM_BE (*(guint32 *) GST_BUFFER_DATA (buf));
|
||||||
|
|
||||||
width = (n & 0x00000fff) >> 0;
|
width = (n & 0xfff00000) >> 20;
|
||||||
height = (n & 0x00fff000) >> 12;
|
height = (n & 0x000fff00) >> 8;
|
||||||
asr_idx = (n & 0x0f000000) >> 24;
|
asr_idx = (n & 0x000000f0) >> 4;
|
||||||
fps_idx = (n & 0xf0000000) >> 28;
|
fps_idx = (n & 0x0000000f) >> 0;
|
||||||
|
|
||||||
if (fps_idx >= 9 || fps_idx <= 0)
|
if (fps_idx >= 9 || fps_idx <= 0)
|
||||||
fps_idx = 3; /* well, we need a default */
|
fps_idx = 3; /* well, we need a default */
|
||||||
|
@ -175,12 +175,16 @@ mp1videoparse_parse_seq (Mp1VideoParse *mp1videoparse, GstBuffer *buf)
|
||||||
width != mp1videoparse->width ||
|
width != mp1videoparse->width ||
|
||||||
height != mp1videoparse->height) {
|
height != mp1videoparse->height) {
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
gint p_w, p_h;
|
||||||
|
|
||||||
mp1videoparse->asr = asr_table[asr_idx];
|
mp1videoparse->asr = asr_table[asr_idx];
|
||||||
mp1videoparse->fps = fps_table[fps_idx];
|
mp1videoparse->fps = fps_table[fps_idx];
|
||||||
mp1videoparse->width = width;
|
mp1videoparse->width = width;
|
||||||
mp1videoparse->height = height;
|
mp1videoparse->height = height;
|
||||||
|
|
||||||
|
p_w = (asr_table[asr_idx] < 1.0) ? (100 / asr_table[asr_idx]) : 1;
|
||||||
|
p_h = (asr_table[asr_idx] > 1.0) ? (100 * asr_table[asr_idx]) : 1;
|
||||||
|
|
||||||
caps = GST_CAPS_NEW ("mp1videoparse_src",
|
caps = GST_CAPS_NEW ("mp1videoparse_src",
|
||||||
"video/mpeg",
|
"video/mpeg",
|
||||||
"systemstream", GST_PROPS_BOOLEAN (FALSE),
|
"systemstream", GST_PROPS_BOOLEAN (FALSE),
|
||||||
|
@ -188,8 +192,8 @@ mp1videoparse_parse_seq (Mp1VideoParse *mp1videoparse, GstBuffer *buf)
|
||||||
"width", GST_PROPS_INT (width),
|
"width", GST_PROPS_INT (width),
|
||||||
"height", GST_PROPS_INT (height),
|
"height", GST_PROPS_INT (height),
|
||||||
"framerate", GST_PROPS_FLOAT (fps_table[fps_idx]),
|
"framerate", GST_PROPS_FLOAT (fps_table[fps_idx]),
|
||||||
"pixel_width", GST_PROPS_INT (1),
|
"pixel_width", GST_PROPS_INT (p_w),
|
||||||
"pixel_height", GST_PROPS_INT (1)); /* FIXME */
|
"pixel_height", GST_PROPS_INT (p_h));
|
||||||
|
|
||||||
gst_caps_debug (caps, "New mpeg1videoparse caps");
|
gst_caps_debug (caps, "New mpeg1videoparse caps");
|
||||||
|
|
||||||
|
@ -202,12 +206,16 @@ mp1videoparse_parse_seq (Mp1VideoParse *mp1videoparse, GstBuffer *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
mp1videoparse_valid_sync (Mp1VideoParse *mp1videoparse, gulong head, GstBuffer *buf)
|
mp1videoparse_valid_sync (Mp1VideoParse *mp1videoparse, guint32 head, GstBuffer *buf)
|
||||||
{
|
{
|
||||||
switch (head) {
|
switch (head) {
|
||||||
case SEQ_START_CODE:
|
case SEQ_START_CODE: {
|
||||||
mp1videoparse_parse_seq(mp1videoparse, buf);
|
GstBuffer *subbuf = gst_buffer_create_sub (buf, 4,
|
||||||
|
GST_BUFFER_SIZE (buf) - 4);
|
||||||
|
mp1videoparse_parse_seq(mp1videoparse, subbuf);
|
||||||
|
gst_buffer_unref (subbuf);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
case GOP_START_CODE:
|
case GOP_START_CODE:
|
||||||
case PICTURE_START_CODE:
|
case PICTURE_START_CODE:
|
||||||
case USER_START_CODE:
|
case USER_START_CODE:
|
||||||
|
|
Loading…
Reference in a new issue