files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  #
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  
  '''pyglet is a cross-platform games and multimedia package.
  
  Detailed documentation is available at http://www.pyglet.org
  '''
  from __future__ import print_function
  from __future__ import absolute_import
  
  # Check if future is installed, if not use included batteries
  try:
      import future
  except ImportError:
      import os.path as op
      import sys
      future_base = op.abspath(op.join(op.dirname(__file__), 'extlibs', 'future'))
      sys.path.insert(0, op.join(future_base, 'py2_3'))
      if sys.version_info[:2] < (3, 0):
          sys.path.insert(0, op.join(future_base, 'py2'))
      del future_base
      del sys
      del op
      try:
          import future
      except ImportError:
          print('Failed to get python-future')
          raise
  
  from builtins import range
  from builtins import object
  
  import os
  import sys
  import warnings
  
  _is_epydoc = hasattr(sys, 'is_epydoc') and sys.is_epydoc
  
  #: The release version of this pyglet installation.
  #:
  #: Valid only if pyglet was installed from a source or binary distribution
  #: (i.e. not in a checked-out copy from SVN).
  #:
  #: Use setuptools if you need to check for a specific release version, e.g.::
  #:
  #:    >>> import pyglet
  #:    >>> from pkg_resources import parse_version
  #:    >>> parse_version(pyglet.version) >= parse_version('1.1')
  #:    True
  #:
  version = '1.2.2'
  
  # Pyglet platform treats *BSD systems as Linux
  compat_platform = sys.platform
  if "bsd" in compat_platform:
      compat_platform = "linux-compat"
  
  def _require_ctypes_version(version):
      # Check ctypes version
      import ctypes
      req = [int(i) for i in version.split('.')]
      have = [int(i) for i in ctypes.__version__.split('.')]
      if not tuple(have) >= tuple(req):
          raise ImportError('pyglet requires ctypes %s or later.' % version)
  _require_ctypes_version('1.0.0')
  
  _enable_optimisations = not __debug__
  if getattr(sys, 'frozen', None):
      _enable_optimisations = True
  
  #: Global dict of pyglet options.  To change an option from its default, you
  #: must import ``pyglet`` before any sub-packages.  For example::
  #:
  #:      import pyglet
  #:      pyglet.options['debug_gl'] = False
  #:
  #: The default options can be overridden from the OS environment.  The
  #: corresponding environment variable for each option key is prefaced by
  #: ``PYGLET_``.  For example, in Bash you can set the ``debug_gl`` option with::
  #:
  #:      PYGLET_DEBUG_GL=True; export PYGLET_DEBUG_GL
  #:
  #: For options requiring a tuple of values, separate each value with a comma.
  #:
  #: The non-development options are:
  #:
  #: audio
  
  [... the rest is omitted ...]
files: pyglet/__init__.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  #
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  
  '''pyglet is a cross-platform games and multimedia package.
  
  Detailed documentation is available at http://www.pyglet.org
  '''
  from __future__ import print_function
  from __future__ import absolute_import
  
  # Check if future is installed, if not use included batteries
  try:
      import future
  except ImportError:
      import os.path as op
      import sys
      future_base = op.abspath(op.join(op.dirname(__file__), 'extlibs', 'future'))
      sys.path.insert(0, op.join(future_base, 'py2_3'))
      if sys.version_info[:2] < (3, 0):
          sys.path.insert(0, op.join(future_base, 'py2'))
      del future_base
      del sys
      del op
      try:
          import future
      except ImportError:
          print('Failed to get python-future')
          raise
  
  from builtins import range
  from builtins import object
  
  import os
  import sys
  import warnings
  
  _is_epydoc = hasattr(sys, 'is_epydoc') and sys.is_epydoc
  
  #: The release version of this pyglet installation.
  #:
  #: Valid only if pyglet was installed from a source or binary distribution
  #: (i.e. not in a checked-out copy from SVN).
  #:
  #: Use setuptools if you need to check for a specific release version, e.g.::
  #:
  #:    >>> import pyglet
  #:    >>> from pkg_resources import parse_version
  #:    >>> parse_version(pyglet.version) >= parse_version('1.1')
  #:    True
  #:
  version = '1.2.2'
  
  # Pyglet platform treats *BSD systems as Linux
  compat_platform = sys.platform
  if "bsd" in compat_platform:
      compat_platform = "linux-compat"
  
  def _require_ctypes_version(version):
      # Check ctypes version
      import ctypes
      req = [int(i) for i in version.split('.')]
      have = [int(i) for i in ctypes.__version__.split('.')]
      if not tuple(have) >= tuple(req):
          raise ImportError('pyglet requires ctypes %s or later.' % version)
  _require_ctypes_version('1.0.0')
  
  _enable_optimisations = not __debug__
  if getattr(sys, 'frozen', None):
      _enable_optimisations = True
  
  #: Global dict of pyglet options.  To change an option from its default, you
  #: must import ``pyglet`` before any sub-packages.  For example::
  #:
  #:      import pyglet
  #:      pyglet.options['debug_gl'] = False
  #:
  #: The default options can be overridden from the OS environment.  The
  #: corresponding environment variable for each option key is prefaced by
  #: ``PYGLET_``.  For example, in Bash you can set the ``debug_gl`` option with::
  #:
  #:      PYGLET_DEBUG_GL=True; export PYGLET_DEBUG_GL
  #:
  #: For options requiring a tuple of values, separate each value with a comma.
  #:
  #: The non-development options are:
  #:
  #: audio
  
  [... the rest is omitted ...]
files: pyglet/__init__.py
files: """Sources for media playback."""
  
  # Collect public interface
  from .loader import load, have_ffmpeg
  from .base import AudioFormat, VideoFormat, AudioData, SourceInfo
  from .base import Source, StreamingSource, StaticSource, SourceGroup
  
  [... the rest is omitted ...]
files: pyglet/media/sources/__init__.py
files: """Sources for media playback."""
  
  # Collect public interface
  from .loader import load, have_ffmpeg
  from .base import AudioFormat, VideoFormat, AudioData, SourceInfo
  from .base import Source, StreamingSource, StaticSource, SourceGroup
  
  # from . import ffmpeg
  
  
  [... the rest is omitted ...]
files: pyglet/media/sources/__init__.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libavcodec/avcodec.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  
  import pyglet
  import pyglet.lib
  from . import libavutil
  
  if pyglet.compat_platform == 'win32':
      for libname in pyglet.options['ffmpeg_libs_win']:
          if libname.startswith('avcodec'):
              avcodec = pyglet.lib.load_library(libname)
              break
      else:
          # As a last resort, try to load the dll with default name.
          avcodec = pyglet.lib.load_library('avcodec')
  else:
      avcodec = pyglet.lib.load_library('avcodec')
  
  FF_INPUT_BUFFER_PADDING_SIZE = 32
  
  class AVPacketSideData(Structure): pass
  AVBufferRef = libavutil.AVBufferRef
  
  class AVPacket(Structure):
      _fields_ = [
          ('buf', POINTER(AVBufferRef)),
          ('pts', c_int64),
          ('dts', c_int64),
          ('data', POINTER(c_uint8)),
          ('size', c_int),
          ('stream_index', c_int),
          ('flags', c_int),
          ('side_data', POINTER(AVPacketSideData)),
          ('side_data_elems', c_int),
          ('duration', c_int64),
          ('pos', c_int64),
          ('convergence_duration', c_int64) #Deprecated
      ]
  class AVCodecParserContext(Structure): pass
  
  AVRational = libavutil.AVRational
  class AVCodecParameters(Structure):
      _fields_ = [
          ('codec_type', c_int),
          ('codec_id', c_int),
          ('codec_tag', c_uint32),
          ('extradata', POINTER(c_uint8)),
          ('extradata_size', c_int),
          ('format', c_int),
          ('bit_rate', c_int64),
          ('bits_per_coded_sample', c_int),
          ('bits_per_raw_sample', c_int),
          ('profile', c_int),
          ('level', c_int),
          ('width', c_int),
          ('height', c_int),
          ('sample_aspect_ratio', AVRational),
          ('field_order', c_int),
          ('color_range', c_int),
          ('color_primaries', c_int),
          ('color_trc', c_int),
          ('color_space', c_int),
          ('chroma_location', c_int),
          ('video_delay', c_int),
          ('channel_layout', c_uint64),
          ('channels', c_int),
          ('sample_rate', c_int),
          ('block_align', c_int),
          ('frame_size', c_int),
          ('initial_padding', c_int),
          ('trailing_padding', c_int),
          ('seek_preroll', c_int),
  
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libavcodec.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libavcodec/avcodec.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  from sys import platform
  
  import pyglet.lib
  from . import libavutil
  
  if platform == 'win32':
      avcodec = pyglet.lib.load_library('avcodec-57')
  else:
      avcodec = pyglet.lib.load_library('avcodec')
  
  FF_INPUT_BUFFER_PADDING_SIZE = 32
  
  class AVPacketSideData(Structure): pass
  AVBufferRef = libavutil.AVBufferRef
  
  class AVPacket(Structure):
      _fields_ = [
          ('buf', POINTER(AVBufferRef)),
          ('pts', c_int64),
          ('dts', c_int64),
          ('data', POINTER(c_uint8)),
          ('size', c_int),
          ('stream_index', c_int),
          ('flags', c_int),
          ('side_data', POINTER(AVPacketSideData)),
          ('side_data_elems', c_int),
          ('duration', c_int64),
          ('pos', c_int64),
          ('convergence_duration', c_int64) #Deprecated
      ]
  class AVCodecParserContext(Structure): pass
  
  AVRational = libavutil.AVRational
  class AVCodecParameters(Structure):
      _fields_ = [
          ('codec_type', c_int),
          ('codec_id', c_int),
          ('codec_tag', c_uint32),
          ('extradata', POINTER(c_uint8)),
          ('extradata_size', c_int),
          ('format', c_int),
          ('bit_rate', c_int64),
          ('bits_per_coded_sample', c_int),
          ('bits_per_raw_sample', c_int),
          ('profile', c_int),
          ('level', c_int),
          ('width', c_int),
          ('height', c_int),
          ('sample_aspect_ratio', AVRational),
          ('field_order', c_int),
          ('color_range', c_int),
          ('color_primaries', c_int),
          ('color_trc', c_int),
          ('color_space', c_int),
          ('chroma_location', c_int),
          ('video_delay', c_int),
          ('channel_layout', c_uint64),
          ('channels', c_int),
          ('sample_rate', c_int),
          ('block_align', c_int),
          ('frame_size', c_int),
          ('initial_padding', c_int),
          ('trailing_padding', c_int),
          ('seek_preroll', c_int),
      ]
  class AVCodecInternal(Structure): pass
  class AVCodec(Structure):
      _fields_ = [
          ('name', c_char_p),
          ('long_name', c_char_p),
          # And more...
      ]
  class AVCodecContext(Structure): pass
  class RcOverride(Structure): pass
  class AVHWAccel
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libavcodec.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libavformat/avformat.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  
  import pyglet
  import pyglet.lib
  from . import libavcodec
  from . import libavutil
  
  if pyglet.compat_platform == 'win32':
      for libname in pyglet.options['ffmpeg_libs_win']:
          if libname.startswith('avformat'):
              avformat = pyglet.lib.load_library(libname)
              break
      else:
          # As a last resort, try to load the dll with default name.
          avformat = pyglet.lib.load_library('avformat')
  else:
      avformat = pyglet.lib.load_library('avformat')
  
  AVSEEK_FLAG_BACKWARD = 1 # ///< seek backward
  AVSEEK_FLAG_BYTE = 2     # ///< seeking based on position in bytes
  AVSEEK_FLAG_ANY = 4      # ///< seek to any frame, even non-keyframes
  AVSEEK_FLAG_FRAME = 8    # ///< seeking based on frame number
  
  MAX_REORDER_DELAY = 16
  
  class AVPacketList(Structure): pass
  class AVInputFormat(Structure): 
      _fields_ = [
          ('name', c_char_p)
      ]
  class AVOutputFormat(Structure): pass
  class AVIOContext(Structure): pass
  class AVIndexEntry(Structure): pass
  class AVStreamInfo(Structure):
      _fields_ = [
          ('last_dts', c_int64),
          ('duration_gcd', c_int64),
          ('duration_count', c_int),
          ('rfps_duration_sum', c_int64),
          ('duration_error', POINTER(c_double * 2 * (30*12+30+3+6))),
          ('codec_info_duration', c_int64), 
          ('codec_info_duration_fields', c_int64), 
          ('found_decoder', c_int), 
          ('last_duration', c_int64), 
          ('fps_first_dts', c_int64), 
          ('fps_first_dts_idx', c_int), 
          ('fps_last_dts', c_int64), 
          ('fps_last_dts_idx', c_int), 
       ]
  class AVProbeData(Structure):
      _fields_ = [
          ('filename', c_char_p),
          ('buf', POINTER(c_ubyte)),
          ('buf_size', c_int),
          ('mime_type', c_char_p)
      ]
  class FFFrac(Structure): pass
  class AVStreamInternal(Structure): pass
  class AVFrac(Structure):
      _fields_ = [
          ('val', c_int64),
          ('num', c_int64),
          ('den', c_int64),
      ]
  
  AVCodecContext = libavcodec.AVCodecContext
  AVPacketSideData
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libavformat.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libavformat/avformat.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  from sys import platform
  
  import pyglet.lib
  from . import libavcodec
  from . import libavutil
  
  if platform == 'win32':
      avformat = pyglet.lib.load_library('avformat-57')
  else:
      avformat = pyglet.lib.load_library('avformat')
  
  AVSEEK_FLAG_BACKWARD = 1 # ///< seek backward
  AVSEEK_FLAG_BYTE = 2     # ///< seeking based on position in bytes
  AVSEEK_FLAG_ANY = 4      # ///< seek to any frame, even non-keyframes
  AVSEEK_FLAG_FRAME = 8    # ///< seeking based on frame number
  
  MAX_REORDER_DELAY = 16
  
  class AVPacketList(Structure): pass
  class AVInputFormat(Structure): 
      _fields_ = [
          ('name', c_char_p)
      ]
  class AVOutputFormat(Structure): pass
  class AVIOContext(Structure): pass
  class AVIndexEntry(Structure): pass
  class AVStreamInfo(Structure):
      _fields_ = [
          ('last_dts', c_int64),
          ('duration_gcd', c_int64),
          ('duration_count', c_int),
          ('rfps_duration_sum', c_int64),
          ('duration_error', POINTER(c_double * 2 * (30*12+30+3+6))),
          ('codec_info_duration', c_int64), 
          ('codec_info_duration_fields', c_int64), 
          ('found_decoder', c_int), 
          ('last_duration', c_int64), 
          ('fps_first_dts', c_int64), 
          ('fps_first_dts_idx', c_int), 
          ('fps_last_dts', c_int64), 
          ('fps_last_dts_idx', c_int), 
       ]
  class AVProbeData(Structure):
      _fields_ = [
          ('filename', c_char_p),
          ('buf', POINTER(c_ubyte)),
          ('buf_size', c_int),
          ('mime_type', c_char_p)
      ]
  class FFFrac(Structure): pass
  class AVStreamInternal(Structure): pass
  class AVFrac(Structure):
      _fields_ = [
          ('val', c_int64),
          ('num', c_int64),
          ('den', c_int64),
      ]
  
  AVCodecContext = libavcodec.AVCodecContext
  AVPacketSideData = libavcodec.AVPacketSideData
  AVPacket = libavcodec.AVPacket
  AVCodecParserContext = libavcodec.AVCodecParserContext
  AVCodecParameters = libavcodec.AVCodecParameters
  AVRational = libavutil.AVRational
  AVDictionary = libavutil.A
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libavformat.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libavutil/avutil.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  
  import pyglet
  import pyglet.lib
  
  if pyglet.compat_platform == 'win32':
      for libname in pyglet.options['ffmpeg_libs_win']:
          if libname.startswith('avutil'):
              avutil = pyglet.lib.load_library(libname)
              break
      else:
          # As a last resort, try to load the dll with default name.
          avutil = pyglet.lib.load_library('avutil')
  else:
      avutil = pyglet.lib.load_library('avutil')
  
  AVMEDIA_TYPE_UNKNOWN = -1
  AVMEDIA_TYPE_VIDEO = 0
  AVMEDIA_TYPE_AUDIO = 1
  AVMEDIA_TYPE_DATA = 2
  AVMEDIA_TYPE_SUBTITLE = 3
  AVMEDIA_TYPE_ATTACHMENT = 4
  AVMEDIA_TYPE_NB = 5
  
  AV_SAMPLE_FMT_U8 = 0
  AV_SAMPLE_FMT_S16 = 1
  AV_SAMPLE_FMT_S32 = 2
  AV_SAMPLE_FMT_FLT = 3
  AV_SAMPLE_FORMAT_DOUBLE = 4
  AV_SAMPLE_FMT_U8P = 5
  AV_SAMPLE_FMT_S16P = 6
  AV_SAMPLE_FMT_S32P = 7
  AV_SAMPLE_FMT_FLTP = 8
  AV_SAMPLE_FMT_DBLP = 9
  AV_SAMPLE_FMT_S64 = 10
  AV_SAMPLE_FMT_S64P = 11
  
  AV_NUM_DATA_POINTERS = 8
  
  AV_PIX_FMT_RGB24 = 2
  
  class AVBufferRef(Structure): pass
  
  
  class AVDictionaryEntry(Structure):
      _fields_ = [
          ('key', c_char_p),
          ('value', c_char_p)
      ]
  class AVDictionary(Structure):
      _fields_ = [
          ('count', c_int),
          ('elems', POINTER(AVDictionaryEntry))
      ]
  
  class AVClass(Structure): pass
  class AVRational(Structure):
      _fields_ = [
          ('num', c_int),
          ('den', c_int)
      ]
  
  class AVFrameSideData(Structure): pass
  class AVFrame(Structure): 
      _fields_ = [
          ('data', POINTER(c_uint8) * AV_NUM_DATA_POINTERS),
          ('linesize', c_int * AV_NUM_DATA_POINTERS),
          ('extended_data', POINTER(POINTER(c_uint8))),
          ('width', c_int),
          ('height', c_int),
          ('nb_samples', c_int),
          ('format', c_int),
          ('key_frame', c_int),
          ('pict_type', c_int),
          ('sample_aspect_ratio',
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libavutil.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libavutil/avutil.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  from sys import platform
  
  import pyglet.lib
  
  if platform == 'win32':
      avutil = pyglet.lib.load_library('avutil-55')
  else:
      avutil = pyglet.lib.load_library('avutil')
  
  AVMEDIA_TYPE_UNKNOWN = -1
  AVMEDIA_TYPE_VIDEO = 0
  AVMEDIA_TYPE_AUDIO = 1
  AVMEDIA_TYPE_DATA = 2
  AVMEDIA_TYPE_SUBTITLE = 3
  AVMEDIA_TYPE_ATTACHMENT = 4
  AVMEDIA_TYPE_NB = 5
  
  AV_SAMPLE_FMT_U8 = 0
  AV_SAMPLE_FMT_S16 = 1
  AV_SAMPLE_FMT_S32 = 2
  AV_SAMPLE_FMT_FLT = 3
  AV_SAMPLE_FORMAT_DOUBLE = 4
  AV_SAMPLE_FMT_U8P = 5
  AV_SAMPLE_FMT_S16P = 6
  AV_SAMPLE_FMT_S32P = 7
  AV_SAMPLE_FMT_FLTP = 8
  AV_SAMPLE_FMT_DBLP = 9
  AV_SAMPLE_FMT_S64 = 10
  AV_SAMPLE_FMT_S64P = 11
  
  AV_NUM_DATA_POINTERS = 8
  
  AV_PIX_FMT_RGB24 = 2
  
  class AVBufferRef(Structure): pass
  
  
  class AVDictionaryEntry(Structure):
      _fields_ = [
          ('key', c_char_p),
          ('value', c_char_p)
      ]
  class AVDictionary(Structure):
      _fields_ = [
          ('count', c_int),
          ('elems', POINTER(AVDictionaryEntry))
      ]
  
  class AVClass(Structure): pass
  class AVRational(Structure):
      _fields_ = [
          ('num', c_int),
          ('den', c_int)
      ]
  
  class AVFrameSideData(Structure): pass
  class AVFrame(Structure): 
      _fields_ = [
          ('data', POINTER(c_uint8) * AV_NUM_DATA_POINTERS),
          ('linesize', c_int * AV_NUM_DATA_POINTERS),
          ('extended_data', POINTER(POINTER(c_uint8))),
          ('width', c_int),
          ('height', c_int),
          ('nb_samples', c_int),
          ('format', c_int),
          ('key_frame', c_int),
          ('pict_type', c_int),
          ('sample_aspect_ratio', AVRational),
          ('pts', c_int64),
          ('pkt_pts', c_int64),
          ('pkt_dts', c_int64),
          ('coded_picture_number', c_int),
          ('display_picture_number', c_int),
          ('quality', c_int),
          ('opaque', c_void_p
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libavutil.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libswresample/swresample.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  
  import pyglet
  import pyglet.lib
  
  if pyglet.compat_platform == 'win32':
      for libname in pyglet.options['ffmpeg_libs_win']:
          if libname.startswith('swresample'):
              swresample = pyglet.lib.load_library(libname)
              break
      else:
          # As a last resort, try to load the dll with default name.
          swresample = pyglet.lib.load_library('swresample')
  else:
      swresample = pyglet.lib.load_library('swresample')
  
  SWR_CH_MAX = 32
  
  class SwrContext(Structure): pass
  
  swresample.swr_alloc_set_opts.restype = POINTER(SwrContext)
  swresample.swr_alloc_set_opts.argtypes = [POINTER(SwrContext),
          c_int64, c_int, c_int, c_int64,
          c_int, c_int, c_int, c_void_p]
  swresample.swr_init.restype = c_int
  swresample.swr_init.argtypes = [POINTER(SwrContext)]
  swresample.swr_free.argtypes = [POINTER(POINTER(SwrContext))]
  swresample.swr_convert.restype = c_int
  swresample.swr_convert.argtypes = [POINTER(SwrContext),
          POINTER(c_uint8) * SWR_CH_MAX,
          c_int,
          POINTER(POINTER(c_uint8)),
          c_int]
  
  __all__ = [
  'swresample',
  'SWR_CH_MAX',
  'SwrContext'
  ]
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libswresample.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libswresample/swresample.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  from sys import platform
  
  import pyglet.lib
  
  if platform == 'win32':
      swresample = pyglet.lib.load_library('swresample-2')
  else:
      swresample = pyglet.lib.load_library('swresample')
  
  SWR_CH_MAX = 32
  
  class SwrContext(Structure): pass
  
  swresample.swr_alloc_set_opts.restype = POINTER(SwrContext)
  swresample.swr_alloc_set_opts.argtypes = [POINTER(SwrContext),
          c_int64, c_int, c_int, c_int64,
          c_int, c_int, c_int, c_void_p]
  swresample.swr_init.restype = c_int
  swresample.swr_init.argtypes = [POINTER(SwrContext)]
  swresample.swr_free.argtypes = [POINTER(POINTER(SwrContext))]
  swresample.swr_convert.restype = c_int
  swresample.swr_convert.argtypes = [POINTER(SwrContext),
          POINTER(c_uint8) * SWR_CH_MAX,
          c_int,
          POINTER(POINTER(c_uint8)),
          c_int]
  
  __all__ = [
  'swresample',
  'SWR_CH_MAX',
  'SwrContext'
  ]
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libswresample.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libswscale/swscale.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  
  import pyglet
  import pyglet.lib
  
  if pyglet.compat_platform == 'win32':
      for libname in pyglet.options['ffmpeg_libs_win']:
          if libname.startswith('swscale'):
              swscale = pyglet.lib.load_library(libname)
              break
      else:
          # As a last resort, try to load the dll with default name.
          swscale = pyglet.lib.load_library('swscale')
  else:
      swscale = pyglet.lib.load_library('swscale')
  
  SWS_FAST_BILINEAR = 1
  
  class SwsContext(Structure): pass
  class SwsFilter(Structure): pass
  
  swscale.sws_getCachedContext.restype = POINTER(SwsContext)
  swscale.sws_getCachedContext.argtypes = [POINTER(SwsContext),
              c_int, c_int, c_int, c_int, 
              c_int, c_int, c_int, 
              POINTER(SwsFilter), POINTER(SwsFilter), 
              POINTER(c_double)]
  swscale.sws_freeContext.argtypes = [POINTER(SwsContext)]
  swscale.sws_scale.restype = c_int
  swscale.sws_scale.argtypes = [POINTER(SwsContext),
          POINTER(POINTER(c_uint8)),
          POINTER(c_int),
          c_int, c_int,
          POINTER(POINTER(c_uint8)),
          POINTER(c_int)]
  
  __all__ = [
  'swscale',
  'SWS_FAST_BILINEAR',
  'SwsContext',
  'SwsFilter'
  ]
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libswscale.py
files: # ----------------------------------------------------------------------------
  # pyglet
  # Copyright (c) 2006-2008 Alex Holkner
  # All rights reserved.
  # 
  # Redistribution and use in source and binary forms, with or without
  # modification, are permitted provided that the following conditions 
  # are met:
  #
  #  * Redistributions of source code must retain the above copyright
  #    notice, this list of conditions and the following disclaimer.
  #  * Redistributions in binary form must reproduce the above copyright 
  #    notice, this list of conditions and the following disclaimer in
  #    the documentation and/or other materials provided with the
  #    distribution.
  #  * Neither the name of pyglet nor the names of its
  #    contributors may be used to endorse or promote products
  #    derived from this software without specific prior written
  #    permission.
  #
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  # POSSIBILITY OF SUCH DAMAGE.
  # ----------------------------------------------------------------------------
  '''Wrapper for include/libswscale/swscale.h
  '''
  
  from ctypes import (c_int, c_uint16, c_int32, c_int64, c_uint32, c_uint64, 
      c_uint8, c_uint, c_double, c_float, c_ubyte, c_size_t, c_char, c_char_p, 
      c_void_p, addressof, byref, cast, POINTER, CFUNCTYPE, Structure, Union, 
      create_string_buffer, memmove)
  from sys import platform
  
  import pyglet.lib
  
  if platform == 'win32':
      swscale = pyglet.lib.load_library('swscale-4')
  else:
      swscale = pyglet.lib.load_library('swscale')
  
  SWS_FAST_BILINEAR = 1
  
  class SwsContext(Structure): pass
  class SwsFilter(Structure): pass
  
  swscale.sws_getCachedContext.restype = POINTER(SwsContext)
  swscale.sws_getCachedContext.argtypes = [POINTER(SwsContext),
              c_int, c_int, c_int, c_int, 
              c_int, c_int, c_int, 
              POINTER(SwsFilter), POINTER(SwsFilter), 
              POINTER(c_double)]
  swscale.sws_freeContext.argtypes = [POINTER(SwsContext)]
  swscale.sws_scale.restype = c_int
  swscale.sws_scale.argtypes = [POINTER(SwsContext),
          POINTER(POINTER(c_uint8)),
          POINTER(c_int),
          c_int, c_int,
          POINTER(POINTER(c_uint8)),
          POINTER(c_int)]
  
  __all__ = [
  'swscale',
  'SWS_FAST_BILINEAR',
  'SwsContext',
  'SwsFilter'
  ]
  
  [... the rest is omitted ...]
files: pyglet/media/sources/ffmpeg_lib/libswscale.py