[vlc-commits] mmal: converter: set the output video context

Steve Lhomme git at videolan.org
Fri Jan 24 14:15:45 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 24 11:37:42 2020 +0100| [c74d6d34fbc38e699466516f8144d99d668f5383] | committer: Steve Lhomme

mmal: converter: set the output video context

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c74d6d34fbc38e699466516f8144d99d668f5383
---

 modules/hw/mmal/converter.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/modules/hw/mmal/converter.c b/modules/hw/mmal/converter.c
index a235190581..feae4a6744 100644
--- a/modules/hw/mmal/converter.c
+++ b/modules/hw/mmal/converter.c
@@ -701,6 +701,9 @@ void CloseConverter(vlc_object_t * obj)
     if (sys->component)
         mmal_component_release(sys->component);
 
+    if (p_filter->vctx_out)
+        vlc_video_context_Release(p_filter->vctx_out);
+
     if (sys->dec_dev)
         vlc_decoder_device_Release(sys->dec_dev);
 
@@ -806,6 +809,19 @@ retry:
         goto fail;
     }
 
+    if (hw_mmal_chroma_is_mmal(p_filter->fmt_out.video.i_chroma))
+    {
+        if (hw_mmal_chroma_is_mmal(p_filter->fmt_in.video.i_chroma))
+            p_filter->vctx_out = vlc_video_context_Hold(p_filter->vctx_in);
+        else {
+            p_filter->vctx_out = vlc_video_context_Create(sys->dec_dev, VLC_VIDEO_CONTEXT_MMAL, 0, NULL);
+            if (unlikely(p_filter->vctx_out == NULL)) {
+                msg_Err(p_filter, "failed to create the output video context");
+                goto fail;
+            }
+        }
+    }
+
     if (use_resizer) {
         sys->resizer_type = FILTER_RESIZER_RESIZER;
         sys->is_sliced = true;



More information about the vlc-commits mailing list