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
|
@ -57,14 +57,18 @@ GST_PAD_TEMPLATE_FACTORY (src_template_factory,
|
|||
"video/raw",
|
||||
"format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
|
||||
"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 (
|
||||
"mpeg2dec_src",
|
||||
"video/raw",
|
||||
"format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('I','4','2','0')),
|
||||
"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)
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -252,7 +256,9 @@ gst_mpeg2dec_negotiate_format (GstMpeg2dec *mpeg2dec)
|
|||
"mpeg2dec_negotiate",
|
||||
"video/raw",
|
||||
"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 */
|
||||
trylist = gst_caps_normalize (trylist);
|
||||
|
@ -277,7 +283,7 @@ gst_mpeg2dec_negotiate_format (GstMpeg2dec *mpeg2dec)
|
|||
}
|
||||
trylist = trylist->next;
|
||||
}
|
||||
/* oops list exhausted an nothing was found... */
|
||||
/* oops list exhausted and nothing was found... */
|
||||
if (!trylist) {
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -343,6 +349,8 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
|
|||
{
|
||||
mpeg2dec->width = info->sequence->width;
|
||||
mpeg2dec->height = info->sequence->height;
|
||||
mpeg2dec->pixel_width = info->sequence->pixel_width;
|
||||
mpeg2dec->pixel_height = info->sequence->pixel_height;
|
||||
mpeg2dec->total_frames = 0;
|
||||
|
||||
if (!gst_mpeg2dec_negotiate_format (mpeg2dec)) {
|
||||
|
@ -357,8 +365,10 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
|
|||
break;
|
||||
case STATE_PICTURE:
|
||||
gst_mpeg2dec_alloc_buffer (mpeg2dec, info);
|
||||
if (info->current_picture && (info->current_picture->flags & PIC_MASK_CODING_TYPE) == PIC_FLAG_CODING_TYPE_I &&
|
||||
mpeg2dec->discont_pending) {
|
||||
if (info->current_picture &&
|
||||
(info->current_picture->flags & PIC_MASK_CODING_TYPE) == PIC_FLAG_CODING_TYPE_I &&
|
||||
mpeg2dec->discont_pending)
|
||||
{
|
||||
mpeg2dec->discont_pending = FALSE;
|
||||
mpeg2dec->first = TRUE;
|
||||
if (pts != -1 && mpeg2dec->last_PTS == -1) {
|
||||
|
|
|
@ -77,6 +77,8 @@ struct _GstMpeg2dec {
|
|||
Mpeg2decFormat format;
|
||||
gint width;
|
||||
gint height;
|
||||
gint pixel_width;
|
||||
gint pixel_height;
|
||||
gint frame_rate_code;
|
||||
gint64 total_frames;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue