[vlc-commits] deinterlace/win32: keep off filter owner private data

Rémi Denis-Courmont git at videolan.org
Sun Jun 10 18:03:24 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 10 17:49:20 2018 +0300| [20feba63fc245ab3b784a8cfb87a2f5c561d3df5] | committer: Rémi Denis-Courmont

deinterlace/win32: keep off filter owner private data

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

 modules/hw/d3d11/d3d11_deinterlace.c           | 7 ++-----
 modules/hw/d3d9/dxva2_deinterlace.c            | 7 ++-----
 modules/video_filter/deinterlace/common.c      | 6 +++---
 modules/video_filter/deinterlace/common.h      | 1 +
 modules/video_filter/deinterlace/deinterlace.c | 5 +++++
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index ec5029e9ba..e2a6aab457 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -62,7 +62,6 @@ typedef struct
     ID3D11VideoProcessorOutputView *processorOutput;
 
     struct deinterlace_ctx         context;
-    picture_t *                    (*buffer_new)( filter_t * );
 } filter_sys_t;
 
 struct filter_mode_t
@@ -238,10 +237,10 @@ static struct picture_context_t *d3d11_pic_context_copy(struct picture_context_t
     return &pic_ctx->s;
 }
 
-static picture_t *NewOutputPicture( filter_t *p_filter )
+picture_t *AllocPicture( filter_t *p_filter )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
-    picture_t *pic = p_sys->buffer_new( p_filter );
+    picture_t *pic = filter_NewPicture( p_filter );
     picture_sys_t *pic_sys = pic->p_sys;
     if ( !pic->context )
     {
@@ -464,8 +463,6 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
        goto error;
     }
 
-    sys->buffer_new = filter->owner.video.buffer_new;
-    filter->owner.video.buffer_new = NewOutputPicture;
     filter->fmt_out.video   = out_fmt;
     filter->pf_video_filter = Deinterlace;
     filter->pf_flush        = Flush;
diff --git a/modules/hw/d3d9/dxva2_deinterlace.c b/modules/hw/d3d9/dxva2_deinterlace.c
index 2b90536cbb..90b0440f31 100644
--- a/modules/hw/d3d9/dxva2_deinterlace.c
+++ b/modules/hw/d3d9/dxva2_deinterlace.c
@@ -57,7 +57,6 @@ typedef struct
     SHORT Saturation;
 
     struct deinterlace_ctx         context;
-    picture_t *                    (*buffer_new)( filter_t * );
 } filter_sys_t;
 
 struct filter_mode_t
@@ -250,10 +249,10 @@ static struct picture_context_t *d3d9_pic_context_copy(struct picture_context_t
     return &pic_ctx->s;
 }
 
-static picture_t *NewOutputPicture( filter_t *p_filter )
+picture_t *AllocPicture( filter_t *p_filter )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
-    picture_t *pic = p_sys->buffer_new( p_filter );
+    picture_t *pic = filter_NewPicture( p_filter );
     picture_sys_t *pic_sys = pic->p_sys;
     if ( !pic->context )
     {
@@ -488,8 +487,6 @@ int D3D9OpenDeinterlace(vlc_object_t *obj)
     CoTaskMemFree(processorGUIDs);
     IDirectXVideoProcessorService_Release(processor);
 
-    sys->buffer_new = filter->owner.video.buffer_new;
-    filter->owner.video.buffer_new = NewOutputPicture;
     filter->fmt_out.video   = out_fmt;
     filter->pf_video_filter = Deinterlace;
     filter->pf_flush        = Flush;
diff --git a/modules/video_filter/deinterlace/common.c b/modules/video_filter/deinterlace/common.c
index bd266779f9..d8d794ae2a 100644
--- a/modules/video_filter/deinterlace/common.c
+++ b/modules/video_filter/deinterlace/common.c
@@ -139,7 +139,7 @@ picture_t *DoDeinterlacing( filter_t *p_filter,
     bool b_top_field_first;
 
     /* Request output picture */
-    p_dst[0] = filter_NewPicture( p_filter );
+    p_dst[0] = AllocPicture( p_filter );
     if( p_dst[0] == NULL )
     {
         picture_Release( p_pic );
@@ -221,7 +221,7 @@ picture_t *DoDeinterlacing( filter_t *p_filter,
         {
             /* Note that the effective buffer size depends also on the constant
                private_picture in vout_wrapper.c, since that determines the
-               maximum number of output pictures filter_NewPicture() will
+               maximum number of output pictures AllocPicture() will
                successfully allocate for one input frame.
             */
             msg_Err( p_filter, "Framerate doubler: output buffer too small; "\
@@ -235,7 +235,7 @@ picture_t *DoDeinterlacing( filter_t *p_filter,
         for( int i = 1; i < i_double_rate_alloc_end ; ++i )
         {
             p_dst[i-1]->p_next =
-            p_dst[i]           = filter_NewPicture( p_filter );
+            p_dst[i]           = AllocPicture( p_filter );
             if( p_dst[i] )
             {
                 picture_CopyProperties( p_dst[i], p_pic );
diff --git a/modules/video_filter/deinterlace/common.h b/modules/video_filter/deinterlace/common.h
index 940a87e2a9..e897c3145a 100644
--- a/modules/video_filter/deinterlace/common.h
+++ b/modules/video_filter/deinterlace/common.h
@@ -123,5 +123,6 @@ picture_t *DoDeinterlacing( filter_t *, struct deinterlace_ctx *, picture_t * );
  */
 void FlushDeinterlacing( struct deinterlace_ctx * );
 
+picture_t *AllocPicture( filter_t * );
 
 #endif
diff --git a/modules/video_filter/deinterlace/deinterlace.c b/modules/video_filter/deinterlace/deinterlace.c
index 2574786282..458bd638d0 100644
--- a/modules/video_filter/deinterlace/deinterlace.c
+++ b/modules/video_filter/deinterlace/deinterlace.c
@@ -442,6 +442,11 @@ static void GetOutputFormat( filter_t *p_filter,
  * video filter functions
  *****************************************************************************/
 
+picture_t *AllocPicture( filter_t *filter )
+{
+    return filter_NewPicture( filter );
+}
+
 /* This is the filter function. See Open(). */
 picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic )
 {



More information about the vlc-commits mailing list