[Bug 781537] NVDEC - Nvidia Decoder plugin

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon May 29 08:29:39 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=781537

--- Comment #37 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
(In reply to atopilski at gmail.com from comment #32)
> ::: sys/nvdec/gstnvh264dec.c
> @@ +206,3 @@
> +      GST_DEBUG_FUNCPTR (gst_nvh264dec_set_format);
> +  video_decoder_class->drain = GST_DEBUG_FUNCPTR (gst_nvh264dec_drain);
> +  video_decoder_class->reset = GST_DEBUG_FUNCPTR (gst_nvh264dec_reset);
> 
> I don't know about this, please do it.

I don't have the hardware to test this, so either you'll have to do it or
someone else with the hardware.

But basically you just replace reset() with flush() in your case, that's all.

> @@ +623,3 @@
> +  if (gst_structure_get_int (pad_struct, "width", &width)) {
> +  }
> +  if (gst_structure_get_int (pad_struct, "height", &height)) {
> 
> Please do it, i don't know about this struct.

Same as above, I can't do that.

Just look at the "info" member of the GstVideoCodec state you get passed in
here. You can e.g. do GST_VIDEO_INFO_WIDTH(&state->info) to get the width, it
will be 0 if unset.

> @@ +822,3 @@
> +      && gst_nvh264dec_dequeue_frame (pnvh264dec, &cuviddisp)) {
> +    GstFlowReturn ret =
> +        gst_nvh264dec_send_decoded_frame (decoder, &cuviddisp, frame);
> 
> In mostly you are right, but i don't know how to get decoded frame in same
> thread where received input data, if play with push/pop context after some
> execution this calls will destroy cuda context(all cuda calls should be done
> in one thread). If you know how to do decoding(in mostly only coping from
> cuda memory) and displaying in same thread please do it.

I don't know, and I don't have the hardware to test anything. You could check
the code in ffmpeg for example.

There's probably a way to attach some opaque information to the frames you pass
to the decoder, and you later get that same information back in the decoded
frame. Like a frame number, or some pointer where you can store something.

You could then use the system_frame_number field of the GstVideoCodecFrame.
Store that in there, and get it back with gst_video_decoder_get_frame().


Without doing this correctly, at least playback of video streams with B-frames
will be broken.

> ::: sys/nvdec/gstnvh264plugin.c
> @@ +36,3 @@
> +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
> +    GST_VERSION_MINOR,
> +    nvh264dec,
> 
> May be better rename target, because cuda cards can decode other stream
> types.

Yes

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list