mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
Added pixel aspect ratio to caps
Original commit message from CVS: Added pixel aspect ratio to caps
This commit is contained in:
parent
8e500986d1
commit
3cfb5663f2
2 changed files with 23 additions and 11 deletions
|
@ -55,16 +55,20 @@ GST_PAD_TEMPLATE_FACTORY (src_template_factory,
|
||||||
GST_CAPS_NEW (
|
GST_CAPS_NEW (
|
||||||
"mpeg2dec_src",
|
"mpeg2dec_src",
|
||||||
"video/raw",
|
"video/raw",
|
||||||
"format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
|
"format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
|
||||||
"width", GST_PROPS_INT_RANGE (16, 4096),
|
"width", GST_PROPS_INT_RANGE (16, 4096),
|
||||||
"height", GST_PROPS_INT_RANGE (16, 4096)
|
"height", GST_PROPS_INT_RANGE (16, 4096),
|
||||||
|
"pixel_width", GST_PROPS_INT_RANGE (1, 255),
|
||||||
|
"pixel_height", GST_PROPS_INT_RANGE (1, 255)
|
||||||
),
|
),
|
||||||
GST_CAPS_NEW (
|
GST_CAPS_NEW (
|
||||||
"mpeg2dec_src",
|
"mpeg2dec_src",
|
||||||
"video/raw",
|
"video/raw",
|
||||||
"format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('I','4','2','0')),
|
"format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('I','4','2','0')),
|
||||||
"width", GST_PROPS_INT_RANGE (16, 4096),
|
"width", GST_PROPS_INT_RANGE (16, 4096),
|
||||||
"height", GST_PROPS_INT_RANGE (16, 4096)
|
"height", GST_PROPS_INT_RANGE (16, 4096),
|
||||||
|
"pixel_width", GST_PROPS_INT_RANGE (1, 255),
|
||||||
|
"pixel_height", GST_PROPS_INT_RANGE (1, 255)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -251,8 +255,10 @@ gst_mpeg2dec_negotiate_format (GstMpeg2dec *mpeg2dec)
|
||||||
GST_CAPS_NEW (
|
GST_CAPS_NEW (
|
||||||
"mpeg2dec_negotiate",
|
"mpeg2dec_negotiate",
|
||||||
"video/raw",
|
"video/raw",
|
||||||
"width", GST_PROPS_INT (mpeg2dec->width),
|
"width", GST_PROPS_INT (mpeg2dec->width),
|
||||||
"height", GST_PROPS_INT (mpeg2dec->height)
|
"height", GST_PROPS_INT (mpeg2dec->height),
|
||||||
|
"pixel_width", GST_PROPS_INT (mpeg2dec->pixel_width),
|
||||||
|
"pixel_height", GST_PROPS_INT (mpeg2dec->pixel_height)
|
||||||
));
|
));
|
||||||
/* prepare for looping */
|
/* prepare for looping */
|
||||||
trylist = gst_caps_normalize (trylist);
|
trylist = gst_caps_normalize (trylist);
|
||||||
|
@ -277,7 +283,7 @@ gst_mpeg2dec_negotiate_format (GstMpeg2dec *mpeg2dec)
|
||||||
}
|
}
|
||||||
trylist = trylist->next;
|
trylist = trylist->next;
|
||||||
}
|
}
|
||||||
/* oops list exhausted an nothing was found... */
|
/* oops list exhausted and nothing was found... */
|
||||||
if (!trylist) {
|
if (!trylist) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -343,6 +349,8 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
|
||||||
{
|
{
|
||||||
mpeg2dec->width = info->sequence->width;
|
mpeg2dec->width = info->sequence->width;
|
||||||
mpeg2dec->height = info->sequence->height;
|
mpeg2dec->height = info->sequence->height;
|
||||||
|
mpeg2dec->pixel_width = info->sequence->pixel_width;
|
||||||
|
mpeg2dec->pixel_height = info->sequence->pixel_height;
|
||||||
mpeg2dec->total_frames = 0;
|
mpeg2dec->total_frames = 0;
|
||||||
|
|
||||||
if (!gst_mpeg2dec_negotiate_format (mpeg2dec)) {
|
if (!gst_mpeg2dec_negotiate_format (mpeg2dec)) {
|
||||||
|
@ -357,8 +365,10 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
|
||||||
break;
|
break;
|
||||||
case STATE_PICTURE:
|
case STATE_PICTURE:
|
||||||
gst_mpeg2dec_alloc_buffer (mpeg2dec, info);
|
gst_mpeg2dec_alloc_buffer (mpeg2dec, info);
|
||||||
if (info->current_picture && (info->current_picture->flags & PIC_MASK_CODING_TYPE) == PIC_FLAG_CODING_TYPE_I &&
|
if (info->current_picture &&
|
||||||
mpeg2dec->discont_pending) {
|
(info->current_picture->flags & PIC_MASK_CODING_TYPE) == PIC_FLAG_CODING_TYPE_I &&
|
||||||
|
mpeg2dec->discont_pending)
|
||||||
|
{
|
||||||
mpeg2dec->discont_pending = FALSE;
|
mpeg2dec->discont_pending = FALSE;
|
||||||
mpeg2dec->first = TRUE;
|
mpeg2dec->first = TRUE;
|
||||||
if (pts != -1 && mpeg2dec->last_PTS == -1) {
|
if (pts != -1 && mpeg2dec->last_PTS == -1) {
|
||||||
|
|
|
@ -77,6 +77,8 @@ struct _GstMpeg2dec {
|
||||||
Mpeg2decFormat format;
|
Mpeg2decFormat format;
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
|
gint pixel_width;
|
||||||
|
gint pixel_height;
|
||||||
gint frame_rate_code;
|
gint frame_rate_code;
|
||||||
gint64 total_frames;
|
gint64 total_frames;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue