    {-# LINE 2 "./Media/Streaming/GStreamer/DataProtocol/DataProtocol.chs" #-}
    -- GIMP Toolkit (GTK) Binding for Haskell: binding to gstreamer -*-haskell-*-
    --
    -- Author : Peter Gavin
    -- Created: 1-Apr-2007
    --
    -- Copyright (c) 2007 Peter Gavin
    --
    -- This library is free software: you can redistribute it and/or
    -- modify it under the terms of the GNU Lesser General Public License
    -- as published by the Free Software Foundation, either version 3 of
    -- the License, or (at your option) any later version.
    --
    -- This library is distributed in the hope that it will be useful,
    -- but WITHOUT ANY WARRANTY; without even the implied warranty of
    -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -- Lesser General Public License for more details.
    --
    -- You should have received a copy of the GNU Lesser General Public
    -- License along with this program. If not, see
    -- <http:
    --
    -- GStreamer, the C library which this Haskell library depends on, is
    -- available under LGPL Version 2. The documentation included with
    -- this library is based on the original GStreamer documentation.
    --
    -- | Maintainer : gtk2hs-devel@lists.sourceforge.net
    -- Stability : alpha
    -- Portability : portable (depends on GHC)
    module Media.Streaming.GStreamer.DataProtocol.DataProtocol (
      ) where

    import Media.Streaming.GStreamer.Core.Types
    {-# LINE 34 "./Media/Streaming/GStreamer/DataProtocol/DataProtocol.chs" #-}
    import Media.Streaming.GStreamer.DataProtocol.Constants
    import System.Glib.FFI

    {-# LINE 38 "./Media/Streaming/GStreamer/DataProtocol/DataProtocol.chs" #-}

    data DPPayloadType = DpPayloadNone
                       | DpPayloadBuffer
                       | DpPayloadCaps
                       | DpPayloadEventNone

    instance Enum DPPayloadType where
      fromEnum DpPayloadNone = 0
      fromEnum DpPayloadBuffer = 1
      fromEnum DpPayloadCaps = 2
      fromEnum DpPayloadEventNone = 64

      toEnum 0 = DpPayloadNone
      toEnum 1 = DpPayloadBuffer
      toEnum 2 = DpPayloadCaps
      toEnum 64 = DpPayloadEventNone
      toEnum unmatched = error ("DPPayloadType.toEnum: Cannot match " ++ show unmatched)

      succ DpPayloadNone = DpPayloadBuffer
      succ DpPayloadBuffer = DpPayloadCaps
      succ DpPayloadCaps = DpPayloadEventNone
      succ _ = undefined

      pred DpPayloadBuffer = DpPayloadNone
      pred DpPayloadCaps = DpPayloadBuffer
      pred DpPayloadEventNone = DpPayloadCaps
      pred _ = undefined

      enumFromTo x y | fromEnum x == fromEnum y = [ y ]
                     | otherwise = x : enumFromTo (succ x) y
      enumFrom x = enumFromTo x DpPayloadEventNone
      enumFromThen _ _ =     error "Enum DPPayloadType: enumFromThen not implemented"
      enumFromThenTo _ _ _ =     error "Enum DPPayloadType: enumFromThenTo not implemented"

    {-# LINE 40 "./Media/Streaming/GStreamer/DataProtocol/DataProtocol.chs" #-}

    data DPVersion = DpVersion02
                   | DpVersion10

    instance Enum DPVersion where
      fromEnum DpVersion02 = 1
      fromEnum DpVersion10 = 2

      toEnum 1 = DpVersion02
      toEnum 2 = DpVersion10
      toEnum unmatched = error ("DPVersion.toEnum: Cannot match " ++ show unmatched)

      succ DpVersion02 = DpVersion10
      succ _ = undefined

      pred DpVersion10 = DpVersion02
      pred _ = undefined

      enumFromTo x y | fromEnum x == fromEnum y = [ y ]
                     | otherwise = x : enumFromTo (succ x) y
      enumFrom x = enumFromTo x DpVersion10
      enumFromThen _ _ =     error "Enum DPVersion: enumFromThen not implemented"
      enumFromThenTo _ _ _ =     error "Enum DPVersion: enumFromThenTo not implemented"

    {-# LINE 42 "./Media/Streaming/GStreamer/DataProtocol/DataProtocol.chs" #-}

    type DPPacketizer = Ptr (())
    {-# LINE 44 "./Media/Streaming/GStreamer/DataProtocol/DataProtocol.chs" #-}

    dpInit :: IO ()
    dpInit = gst_dp_init
    {-# LINE 48 "./Media/Streaming/GStreamer/DataProtocol/DataProtocol.chs" #-}

    foreign import ccall safe "gst_dp_init"
      gst_dp_init :: (IO ())