Bug 1206979: P1. Add method to determine which version of libavcodec is available. r=edwin draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 22 Sep 2015 15:21:47 +1000
changeset 607015 2b03bc846310350c4fed031b72f01edfe832cf94
parent 607014 10db198e218b83f0637a2ba59667d22ad2521119
child 607016 a3f53f03e16d1a3bdf71c2f4a97ebd9c51567456
push id93006
push userjyavenard@mozilla.com
push dateThu, 15 Oct 2015 05:15:33 +0000
treeherdertry@45ea2a01301e [default view] [failures only]
reviewersedwin
bugs1206979
milestone43.0a2
Bug 1206979: P1. Add method to determine which version of libavcodec is available. r=edwin
dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
dom/media/platforms/ffmpeg/FFmpegFunctionList.h
--- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
+++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h
@@ -20,16 +20,25 @@ class FFmpegDecoderModule : public Platf
 public:
   static already_AddRefed<PlatformDecoderModule>
   Create()
   {
     nsRefPtr<PlatformDecoderModule> pdm = new FFmpegDecoderModule();
     return pdm.forget();
   }
 
+  static bool
+  GetVersion(uint32_t& aMajor, uint32_t& aMinor)
+  {
+    uint32_t version = avcodec_version();
+    aMajor = (version >> 16) & 0xff;
+    aMinor = (version >> 8) & 0xff;
+    return true;
+  }
+
   FFmpegDecoderModule() {}
   virtual ~FFmpegDecoderModule() {}
 
   virtual already_AddRefed<MediaDataDecoder>
   CreateVideoDecoder(const VideoInfo& aConfig,
                      layers::LayersBackend aLayersBackend,
                      layers::ImageContainer* aImageContainer,
                      FlushableTaskQueue* aVideoTaskQueue,
--- a/dom/media/platforms/ffmpeg/FFmpegFunctionList.h
+++ b/dom/media/platforms/ffmpeg/FFmpegFunctionList.h
@@ -18,16 +18,17 @@ AV_FUNC(avcodec_flush_buffers, 0)
 AV_FUNC(avcodec_alloc_context3, 0)
 AV_FUNC(avcodec_get_edge_width, 0)
 AV_FUNC(avcodec_open2, 0)
 AV_FUNC(av_init_packet, 0)
 AV_FUNC(av_dict_get, 0)
 AV_FUNC(av_parser_init, 0)
 AV_FUNC(av_parser_close, 0)
 AV_FUNC(av_parser_parse2, 0)
+AV_FUNC(avcodec_version, 0)
 
 /* libavutil */
 AV_FUNC(av_image_fill_linesizes, 0)
 AV_FUNC(av_image_fill_pointers, 0)
 AV_FUNC(av_log_set_level, 0)
 AV_FUNC(av_malloc, 0)
 AV_FUNC(av_freep, 0)