[vlc-commits] decoder: remove decoder_LinkPicture()

Rémi Denis-Courmont git at videolan.org
Sat Nov 1 10:31:46 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 30 23:05:51 2014 +0200| [3cfb5fe97a1ef81922d0ee7c67a626bd5887f7dc] | committer: Rémi Denis-Courmont

decoder: remove decoder_LinkPicture()

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

 include/vlc_codec.h                  |    9 +--------
 modules/codec/avcodec/video.c        |    4 ++--
 modules/codec/libmpeg2.c             |    2 +-
 modules/stream_out/mosaic_bridge.c   |    8 --------
 modules/stream_out/transcode/video.c |    7 -------
 src/input/decoder.c                  |   10 ----------
 src/libvlccore.sym                   |    1 -
 src/misc/image.c                     |    7 -------
 8 files changed, 4 insertions(+), 44 deletions(-)

diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 429cfa5..48f8acd 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -96,11 +96,10 @@ struct decoder_t
 
     /* Video output callbacks
      * XXX use decoder_NewPicture/decoder_DeletePicture
-     * and decoder_LinkPicture/decoder_UnlinkPicture */
+     * and decoder_UnlinkPicture */
     int             (*pf_vout_format_update)( decoder_t * );
     picture_t      *(*pf_vout_buffer_new)( decoder_t * );
     void            (*pf_vout_buffer_del)( decoder_t *, picture_t * );
-    void            (*pf_picture_link)   ( decoder_t *, picture_t * );
     void            (*pf_picture_unlink) ( decoder_t *, picture_t * );
 
     /**
@@ -206,12 +205,6 @@ VLC_API picture_t * decoder_NewPicture( decoder_t * ) VLC_USED;
 VLC_API void decoder_DeletePicture( decoder_t *, picture_t *p_picture );
 
 /**
- * This function will increase the picture reference count.
- * (picture_Hold is not usable.)
- */
-VLC_API void decoder_LinkPicture( decoder_t *, picture_t * );
-
-/**
  * This function will decrease the picture reference count.
  * (picture_Release is not usable.)
  */
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index d596b3f..ef1c067 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -755,7 +755,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         else
         {
             p_pic = (picture_t *)p_sys->p_ff_pic->opaque;
-            decoder_LinkPicture( p_dec, p_pic );
+            picture_Hold( p_pic );
         }
 
         if( !p_dec->fmt_in.video.i_sar_num || !p_dec->fmt_in.video.i_sar_den )
@@ -1067,7 +1067,7 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx,
             goto error;
         ref->decoder = dec;
         ref->picture = pic;
-        decoder_LinkPicture(dec, pic);
+        picture_Hold(pic);
 
         uint8_t *data = pic->p[i].p_pixels;
         int size = pic->p[i].i_pitch * pic->p[i].i_lines;
diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index 0367537..48bafe4 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -831,7 +831,7 @@ static picture_t *DpbNewPicture( decoder_t *p_dec )
     p->p_picture = GetNewPicture( p_dec );
     if( p->p_picture )
     {
-        decoder_LinkPicture( p_dec, p->p_picture );
+        picture_Hold( p->p_picture );
         p->b_linked = true;
         p->b_displayed = false;
 
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 46c3d08..627d2e5 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -85,7 +85,6 @@ inline static picture_t *video_new_buffer_filter( filter_t * );
 static int video_update_format( vlc_object_t *, decoder_owner_sys_t *,
                                 es_format_t * );
 
-static void video_link_picture_decoder( decoder_t *, picture_t * );
 static void video_unlink_picture_decoder( decoder_t *, picture_t * );
 
 static int HeightCallback( vlc_object_t *, char const *,
@@ -299,7 +298,6 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
     p_sys->p_decoder->pf_vout_format_update = video_update_format_decoder;
     p_sys->p_decoder->pf_vout_buffer_new = video_new_buffer_decoder;
     p_sys->p_decoder->pf_vout_buffer_del = video_del_buffer_decoder;
-    p_sys->p_decoder->pf_picture_link    = video_link_picture_decoder;
     p_sys->p_decoder->pf_picture_unlink  = video_unlink_picture_decoder;
     p_sys->p_decoder->p_owner = malloc( sizeof(decoder_owner_sys_t) );
     if( !p_sys->p_decoder->p_owner )
@@ -664,12 +662,6 @@ inline static void video_del_buffer_decoder( decoder_t *p_this,
     picture_Release( p_pic );
 }
 
-static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
-{
-    VLC_UNUSED(p_dec);
-    picture_Hold( p_pic );
-}
-
 static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
 {
     VLC_UNUSED(p_dec);
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 8cf96d2..083ede3 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -49,12 +49,6 @@ static void video_del_buffer_decoder( decoder_t *p_decoder, picture_t *p_pic )
     picture_Release( p_pic );
 }
 
-static void video_link_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
-{
-    VLC_UNUSED(p_dec);
-    picture_Hold( p_pic );
-}
-
 static void video_unlink_picture_decoder( decoder_t *p_dec, picture_t *p_pic )
 {
     VLC_UNUSED(p_dec);
@@ -167,7 +161,6 @@ int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
     id->p_decoder->pf_vout_format_update = video_update_format_decoder;
     id->p_decoder->pf_vout_buffer_new = video_new_buffer_decoder;
     id->p_decoder->pf_vout_buffer_del = video_del_buffer_decoder;
-    id->p_decoder->pf_picture_link    = video_link_picture_decoder;
     id->p_decoder->pf_picture_unlink  = video_unlink_picture_decoder;
     id->p_decoder->p_owner = malloc( sizeof(decoder_owner_sys_t) );
     if( !id->p_decoder->p_owner )
diff --git a/src/input/decoder.c b/src/input/decoder.c
index afc90e3..cab4931 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -173,10 +173,6 @@ void decoder_DeletePicture( decoder_t *p_decoder, picture_t *p_picture )
 {
     p_decoder->pf_vout_buffer_del( p_decoder, p_picture );
 }
-void decoder_LinkPicture( decoder_t *p_decoder, picture_t *p_picture )
-{
-    p_decoder->pf_picture_link( p_decoder, p_picture );
-}
 void decoder_UnlinkPicture( decoder_t *p_decoder, picture_t *p_picture )
 {
     p_decoder->pf_picture_unlink( p_decoder, p_picture );
@@ -785,7 +781,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
     p_dec->pf_vout_format_update = vout_update_format;
     p_dec->pf_vout_buffer_new = vout_new_buffer;
     p_dec->pf_vout_buffer_del = vout_del_buffer;
-    p_dec->pf_picture_link    = vout_link_picture;
     p_dec->pf_picture_unlink  = vout_unlink_picture;
     p_dec->pf_spu_buffer_new  = spu_new_buffer;
     p_dec->pf_spu_buffer_del  = spu_del_buffer;
@@ -2196,11 +2191,6 @@ static void vout_del_buffer( decoder_t *p_dec, picture_t *p_pic )
     vout_ReleasePicture( p_dec->p_owner->p_vout, p_pic );
 }
 
-static void vout_link_picture( decoder_t *p_dec, picture_t *p_pic )
-{
-    picture_Hold( p_pic );
-}
-
 static void vout_unlink_picture( decoder_t *p_dec, picture_t *p_pic )
 {
     vout_ReleasePicture( p_dec->p_owner->p_vout, p_pic );
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 03b3882..299dade 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -77,7 +77,6 @@ decoder_DeleteSubpicture
 decoder_GetDisplayDate
 decoder_GetDisplayRate
 decoder_GetInputAttachments
-decoder_LinkPicture
 decoder_NewAudioBuffer
 decoder_NewPicture
 decoder_NewSubpicture
diff --git a/src/misc/image.c b/src/misc/image.c
index a9d436e..968022c 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -602,12 +602,6 @@ static void video_del_buffer( decoder_t *p_dec, picture_t *p_pic )
     picture_Release( p_pic );
 }
 
-static void video_link_picture( decoder_t *p_dec, picture_t *p_pic )
-{
-    (void)p_dec;
-    picture_Hold( p_pic );
-}
-
 static void video_unlink_picture( decoder_t *p_dec, picture_t *p_pic )
 {
     (void)p_dec;
@@ -631,7 +625,6 @@ static decoder_t *CreateDecoder( vlc_object_t *p_this, video_format_t *fmt )
     p_dec->pf_vout_format_update = video_update_format;
     p_dec->pf_vout_buffer_new = video_new_buffer;
     p_dec->pf_vout_buffer_del = video_del_buffer;
-    p_dec->pf_picture_link    = video_link_picture;
     p_dec->pf_picture_unlink  = video_unlink_picture;
 
     /* Find a suitable decoder module */



More information about the vlc-commits mailing list