Merge pull request #4791 from jmarshallnz/playlist_settings
[vuplus_xbmc] / lib / DllAvUtil.h
index 26dd952..0fcdf10 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 /*
  *      Copyright (C) 2005-2013 Team XBMC
- *      http://www.xbmc.org
+ *      http://xbmc.org
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with XBMC; see the file COPYING.  If not, write to the Free
- *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA  02110-1301, USA.
- *  http://www.gnu.org/copyleft/gpl.html
+ *  along with XBMC; see the file COPYING.  If not, see
+ *  <http://www.gnu.org/licenses/>.
  *
  */
 
@@ -109,6 +107,7 @@ public:
   virtual int av_get_channel_layout_channel_index (uint64_t channel_layout, uint64_t channel) = 0;
   virtual int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) = 0;
   virtual int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) = 0;
+  virtual uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index) = 0;
 #if defined(AVFRAME_IN_LAVU)
   virtual void av_frame_free(AVFrame **frame)=0;
   virtual AVFrame *av_frame_alloc(void)=0;
@@ -117,7 +116,7 @@ public:
 #endif
 };
 
-#if defined (USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN)
+#if defined (USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) || (defined USE_STATIC_FFMPEG)
 // Use direct layer
 class DllAvUtilBase : public DllDynamic, DllAvUtilInterface
 {
@@ -163,6 +162,8 @@ public:
     { return ::av_samples_fill_arrays(audio_data, linesize, buf, nb_channels, nb_samples, sample_fmt, align); }
   virtual int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
     { return ::av_samples_copy(dst, src, dst_offset, src_offset, nb_samples, nb_channels, sample_fmt); }
+  virtual uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
+    { return ::av_channel_layout_extract_channel(channel_layout, index); }
 #if defined(AVFRAME_IN_LAVU)
   virtual void av_frame_free(AVFrame **frame) { return ::av_frame_free(frame); }
   virtual AVFrame *av_frame_alloc() { return ::av_frame_alloc(); }
@@ -173,7 +174,7 @@ public:
    // DLL faking.
    virtual bool ResolveExports() { return true; }
    virtual bool Load() {
-#if !defined(TARGET_DARWIN)
+#if !defined(TARGET_DARWIN) && !defined(USE_STATIC_FFMPEG)
      CLog::Log(LOGDEBUG, "DllAvUtilBase: Using libavutil system library");
 #endif
      return true;
@@ -221,6 +222,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface
   DEFINE_METHOD2(int, av_get_channel_layout_channel_index, (uint64_t p1, uint64_t p2))
   DEFINE_METHOD7(int, av_samples_fill_arrays, (uint8_t **p1, int *p2, const uint8_t *p3, int p4, int p5, enum AVSampleFormat p6, int p7))
   DEFINE_METHOD7(int, av_samples_copy, (uint8_t **p1, uint8_t *const *p2, int p3, int p4, int p5, int p6, enum AVSampleFormat p7))
+  DEFINE_METHOD2(uint64_t, av_channel_layout_extract_channel, (uint64_t p1, int p2))
 #if defined(AVFRAME_IN_LAVU)
   DEFINE_METHOD1(void, av_frame_free, (AVFrame **p1))
   DEFINE_METHOD0(AVFrame *, av_frame_alloc)
@@ -262,6 +264,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface
     RESOLVE_METHOD(av_get_channel_layout_channel_index)
     RESOLVE_METHOD(av_samples_fill_arrays)
     RESOLVE_METHOD(av_samples_copy)
+    RESOLVE_METHOD(av_channel_layout_extract_channel)
 #if defined(AVFRAME_IN_LAVU)
     RESOLVE_METHOD(av_frame_free)
     RESOLVE_METHOD(av_frame_alloc)