Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  mediacodec_h264.patch   Sprache: unbekannt

 
Spracherkennung für: .patch vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

diff --git a/media/ffvpx/libavcodec/avcodec.h b/media/ffvpx/libavcodec/avcodec.h
--- a/media/ffvpx/libavcodec/avcodec.h
+++ b/media/ffvpx/libavcodec/avcodec.h
@@ -2106,6 +2106,8 @@ typedef struct AVCodecContext {
     AVFrameSideData  **decoded_side_data;
     int             nb_decoded_side_data;
 
+    int moz_extradata_offset;
+
     void* moz_ndk_crypto;
 } AVCodecContext;
 
diff --git a/media/ffvpx/libavcodec/mediacodecdec.c b/media/ffvpx/libavcodec/mediacodecdec.c
--- a/media/ffvpx/libavcodec/mediacodecdec.c
+++ b/media/ffvpx/libavcodec/mediacodecdec.c
@@ -36,9 +36,13 @@
 #include "avcodec.h"
 #include "codec_internal.h"
 #include "decode.h"
+#if CONFIG_H264_MEDIACODEC_DECODER_EXTRADATA
 #include "h264_parse.h"
 #include "h264_ps.h"
+#endif
+#if CONFIG_HEVC_MEDIACODEC_DECODER_EXTRADATA
 #include "hevc/parse.h"
+#endif
 #include "hwconfig.h"
 #include "internal.h"
 #include "fffjni.h"
@@ -127,9 +131,9 @@ done:
 }
 #endif
 
-#if CONFIG_H264_MEDIACODEC_DECODER
 static int h264_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
 {
+#if CONFIG_H264_MEDIACODEC_DECODER_EXTRADATA
     int i;
     int ret;
 
@@ -190,10 +194,25 @@ done:
     ff_h264_ps_uninit(&ps);
 
     return ret;
-}
+#else
+    const uint8_t* ed = avctx->extradata;
+    int edsize = avctx->extradata_size;
+    int edoffset = avctx->moz_extradata_offset;
+
+    if (ed) {
+        if (edoffset > 0 && edoffset < edsize) {
+            ff_AMediaFormat_setBuffer(format, "csd-0", ed, edoffset);
+            ff_AMediaFormat_setBuffer(format, "csd-1", ed + edoffset, edsize - edoffset);
+        } else {
+            ff_AMediaFormat_setBuffer(format, "csd-0", ed, edsize);
+        }
+    }
+
+    return 0;
 #endif
+}
 
-#if CONFIG_HEVC_MEDIACODEC_DECODER
+#if CONFIG_HEVC_MEDIACODEC_DECODER_EXTRADATA
 static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
 {
     int i;
@@ -297,7 +316,8 @@ done:
     CONFIG_AAC_MEDIACODEC_DECODER   || \
     CONFIG_AMRNB_MEDIACODEC_DECODER || \
     CONFIG_AMRWB_MEDIACODEC_DECODER || \
-    CONFIG_MP3_MEDIACODEC_DECODER
+    CONFIG_MP3_MEDIACODEC_DECODER   || \
+    !CONFIG_HEVC_MEDIACODEC_DECODER_EXTRADATA
 static int common_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
 {
     int ret = 0;
@@ -353,7 +373,11 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
     case AV_CODEC_ID_HEVC:
         codec_mime = "video/hevc";
 
+#if CONFIG_HEVC_MEDIACODEC_DECODER_EXTRADATA
         ret = hevc_set_extradata(avctx, format);
+#else
+        ret = common_set_extradata(avctx, format);
+#endif
         if (ret < 0)
             goto done;
         break;
@@ -637,11 +661,11 @@ const FFCodec ff_ ## short_name ## _mediacodec_decoder = {
 };                                                                                             \
 
 #if CONFIG_H264_MEDIACODEC_DECODER
-DECLARE_MEDIACODEC_VDEC(h264, "H.264", AV_CODEC_ID_H264, "h264_mp4toannexb")
+DECLARE_MEDIACODEC_VDEC(h264, "H.264", AV_CODEC_ID_H264, NULL)
 #endif
 
 #if CONFIG_HEVC_MEDIACODEC_DECODER
-DECLARE_MEDIACODEC_VDEC(hevc, "H.265", AV_CODEC_ID_HEVC, "hevc_mp4toannexb")
+DECLARE_MEDIACODEC_VDEC(hevc, "H.265", AV_CODEC_ID_HEVC, NULL)
 #endif
 

[Dauer der Verarbeitung: 0.36 Sekunden]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002