mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-05 17:09:48 +00:00
basevideo: Add the caps to the GstVideoState and clean up caps/codec_data properly
This commit is contained in:
parent
93a675b570
commit
aaeff26189
3 changed files with 8 additions and 0 deletions
|
@ -114,6 +114,9 @@ gst_base_video_codec_reset (GstBaseVideoCodec * base_video_codec)
|
|||
|
||||
base_video_codec->bytes = 0;
|
||||
base_video_codec->time = 0;
|
||||
|
||||
gst_buffer_replace (&base_video_codec->state.codec_data, NULL);
|
||||
gst_caps_replace (&base_video_codec->state.caps, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -86,6 +86,7 @@ typedef struct _GstBaseVideoCodecClass GstBaseVideoCodecClass;
|
|||
|
||||
struct _GstVideoState
|
||||
{
|
||||
GstCaps *caps;
|
||||
GstVideoFormat format;
|
||||
int width, height;
|
||||
int fps_n, fps_d;
|
||||
|
|
|
@ -255,8 +255,12 @@ gst_base_video_decoder_sink_setcaps (GstPad * pad, GstCaps * caps)
|
|||
|
||||
state = &GST_BASE_VIDEO_CODEC (base_video_decoder)->state;
|
||||
|
||||
gst_buffer_replace (&state->codec_data, NULL);
|
||||
gst_caps_replace (&state->caps, NULL);
|
||||
memset (state, 0, sizeof (GstVideoState));
|
||||
|
||||
state->caps = gst_caps_ref (caps);
|
||||
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
|
||||
gst_video_format_parse_caps (caps, NULL, &state->width, &state->height);
|
||||
|
|
Loading…
Reference in a new issue