Bug 1206979: P1. Add method to determine which version of libavcodec is available. r=edwin a=lizzard
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 22 Sep 2015 15:21:47 +1000
changeset 296460 8de5b42cda2dae1d54225ea664901d822cff40b3
parent 296459 86872269b3310602600d7e227eec2efedac00d5f
child 296461 37cb06914ad6c9f55f0e7dd32070fa961e7c316f
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin, lizzard
bugs1206979
milestone43.0a2
Bug 1206979: P1. Add method to determine which version of libavcodec is available. r=edwin a=lizzard
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)