[FFmpeg-cvslog] Merge commit '19d7667a81499d4357ec8e0851701e17c238e584'

Clément Bœsch git at videolan.org
Wed Jun 29 12:05:08 CEST 2016


ffmpeg | branch: master | Clément Bœsch <clement at stupeflix.com> | Wed Jun 29 12:03:20 2016 +0200| [19fe328f12f6658f7e3feb521ee81a8b13e76e49] | committer: Clément Bœsch

Merge commit '19d7667a81499d4357ec8e0851701e17c238e584'

* commit '19d7667a81499d4357ec8e0851701e17c238e584':
  vaapi_encode: Add support for writing arbitrary additional packed headers

Merged-by: Clément Bœsch <clement at stupeflix.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19fe328f12f6658f7e3feb521ee81a8b13e76e49
---

 libavcodec/vaapi_encode.c |   21 +++++++++++++++++++++
 libavcodec/vaapi_encode.h |    4 ++++
 2 files changed, 25 insertions(+)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 9490516..c55a783 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -293,6 +293,27 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
         }
     }
 
+    if (ctx->codec->write_extra_header) {
+        for (i = 0;; i++) {
+            int type;
+            bit_len = 8 * sizeof(data);
+            err = ctx->codec->write_extra_header(avctx, pic, i, &type,
+                                                 data, &bit_len);
+            if (err == AVERROR_EOF)
+                break;
+            if (err < 0) {
+                av_log(avctx, AV_LOG_ERROR, "Failed to write extra "
+                       "header %d: %d.\n", i, err);
+                goto fail;
+            }
+
+            err = vaapi_encode_make_packed_header(avctx, pic, type,
+                                                  data, bit_len);
+            if (err < 0)
+                goto fail;
+        }
+    }
+
     av_assert0(pic->nb_slices <= MAX_PICTURE_SLICES);
     for (i = 0; i < pic->nb_slices; i++) {
         slice = av_mallocz(sizeof(*slice));
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index b67168b..8f4f653 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -215,6 +215,10 @@ typedef struct VAAPIEncodeType {
                                  VAAPIEncodePicture *pic,
                                  int index, int *type,
                                  char *data, size_t *data_len);
+    int    (*write_extra_header)(AVCodecContext *avctx,
+                                 VAAPIEncodePicture *pic,
+                                 int index, int *type,
+                                 char *data, size_t *data_len);
 } VAAPIEncodeType;
 
 


======================================================================




More information about the ffmpeg-cvslog mailing list