]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ptx.c
matroskadec: use new metadata API to export some simple information
[ffmpeg] / libavcodec / ptx.c
index b3e2919df77ccf36e08e145f4eb384100ef73d1e..2ab45b08a7c4b0eeae6ed7903b31714b332aca3c 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
 typedef struct PTXContext {
     AVFrame picture;
 } PTXContext;
 
-static int ptx_init(AVCodecContext *avctx) {
+static av_cold int ptx_init(AVCodecContext *avctx) {
     PTXContext *s = avctx->priv_data;
 
     avcodec_get_frame_defaults(&s->picture);
@@ -35,10 +36,10 @@ static int ptx_init(AVCodecContext *avctx) {
 }
 
 static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
-                            uint8_t *buf, int buf_size) {
+                            const uint8_t *buf, int buf_size) {
     PTXContext * const s = avctx->priv_data;
     AVFrame *picture = data;
-    AVFrame * const p = (AVFrame *)&s->picture;
+    AVFrame * const p = &s->picture;
     unsigned int offset, w, h, y, stride, bytes_per_pixel;
     uint8_t *ptr;
 
@@ -94,7 +95,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     return offset + w*h*bytes_per_pixel;
 }
 
-static int ptx_end(AVCodecContext *avctx) {
+static av_cold int ptx_end(AVCodecContext *avctx) {
     PTXContext *s = avctx->priv_data;
 
     if(s->picture.data[0])
@@ -113,5 +114,6 @@ AVCodec ptx_decoder = {
     ptx_end,
     ptx_decode_frame,
     0,
-    NULL
+    NULL,
+    .long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
 };