[FFmpeg-cvslog] Merge commit '02fa1ad9266f9b1ea11565ac2f93f45853e351e8'

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:40 2016 +0200| [4b90413cb26eea61a23bc5e9672543cc7da81f92] | committer: Clément Bœsch

Merge commit '02fa1ad9266f9b1ea11565ac2f93f45853e351e8'

* commit '02fa1ad9266f9b1ea11565ac2f93f45853e351e8':
  vaapi_h264: Add source version identifier as unregistered SEI

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

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

 libavcodec/vaapi_encode_h264.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index aa3ab12..db9071f 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -606,6 +606,30 @@ static void vaapi_encode_h264_write_pic_timing(PutBitContext *pbc,
     }
 }
 
+static void vaapi_encode_h264_write_identifier(PutBitContext *pbc,
+                                               VAAPIEncodeContext *ctx,
+                                               VAAPIEncodePicture *pic)
+{
+    const char *lavc   = LIBAVCODEC_IDENT;
+    const char *vaapi  = VA_VERSION_S;
+    const char *driver = vaQueryVendorString(ctx->hwctx->display);
+    char tmp[256];
+    int i;
+
+    // Random (version 4) ISO 11578 UUID.
+    uint8_t uuid[16] = {
+        0x59, 0x94, 0x8b, 0x28, 0x11, 0xec, 0x45, 0xaf,
+        0x96, 0x75, 0x19, 0xd4, 0x1f, 0xea, 0xa9, 0x4d,
+    };
+
+    for (i = 0; i < 16; i++)
+        u(8, uuid[i], uuid_iso_iec_11578);
+
+    snprintf(tmp, sizeof(tmp), "%s / VAAPI %s / %s", lavc, vaapi, driver);
+    for (i = 0; i < sizeof(tmp) && tmp[i]; i++)
+        u(8, tmp[i], user_data_payload_byte);
+}
+
 static void vaapi_encode_h264_write_sei(PutBitContext *pbc,
                                         VAAPIEncodeContext *ctx,
                                         VAAPIEncodePicture *pic)
@@ -633,6 +657,11 @@ static void vaapi_encode_h264_write_sei(PutBitContext *pbc,
                 continue;
             write_payload = &vaapi_encode_h264_write_pic_timing;
             break;
+        case SEI_TYPE_USER_DATA_UNREGISTERED:
+            if (pic->encode_order != 0)
+                continue;
+            write_payload = &vaapi_encode_h264_write_identifier;
+            break;
         default:
             continue;
         }


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




More information about the ffmpeg-cvslog mailing list