module Media.Streaming.GStreamer.Core.GhostPad (
GhostPad,
GhostPadClass,
castToGhostPad,
gTypeGhostPad,
ghostPadNew,
ghostPadNewNoTarget,
ghostPadNewFromTemplate,
ghostPadNewNoTargetFromTemplate,
ghostPadSetTarget,
ghostPadGetTarget
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import Media.Streaming.GStreamer.Core.Types
ghostPadNew :: PadClass pad
=> String
-> pad
-> IO (Maybe Pad)
ghostPadNew name target =
(withUTFString name $
flip (\arg1 (Pad arg2) -> withForeignPtr arg2 $ \argPtr2 ->gst_ghost_pad_new arg1 argPtr2) $ toPad target) >>=
maybePeek takeObject
ghostPadNewNoTarget :: String
-> PadDirection
-> IO (Maybe Pad)
ghostPadNewNoTarget name dir =
(withUTFString name $
flip gst_ghost_pad_new_no_target $ cFromEnum dir) >>=
maybePeek takeObject
ghostPadNewFromTemplate :: String
-> Pad
-> PadTemplate
-> IO (Maybe Pad)
ghostPadNewFromTemplate name target templ =
withUTFString name $ \cName ->
(\arg1 (Pad arg2) (PadTemplate arg3) -> withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gst_ghost_pad_new_from_template arg1 argPtr2 argPtr3) cName target templ >>=
maybePeek takeObject
ghostPadNewNoTargetFromTemplate :: String
-> PadTemplate
-> IO (Maybe Pad)
ghostPadNewNoTargetFromTemplate name templ =
withUTFString name $ \cName ->
(\arg1 (PadTemplate arg2) -> withForeignPtr arg2 $ \argPtr2 ->gst_ghost_pad_new_no_target_from_template arg1 argPtr2) cName templ >>=
maybePeek takeObject
ghostPadSetTarget :: GhostPad
-> Pad
-> IO Bool
ghostPadSetTarget gpad newtarget =
liftM toBool $ (\(GhostPad arg1) (Pad arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gst_ghost_pad_set_target argPtr1 argPtr2) gpad newtarget
ghostPadGetTarget :: GhostPad
-> IO Pad
ghostPadGetTarget gpad =
(\(GhostPad arg1) -> withForeignPtr arg1 $ \argPtr1 ->gst_ghost_pad_get_target argPtr1) gpad >>= takeObject
foreign import ccall safe "gst_ghost_pad_new"
gst_ghost_pad_new :: ((Ptr CChar) -> ((Ptr Pad) -> (IO (Ptr Pad))))
foreign import ccall safe "gst_ghost_pad_new_no_target"
gst_ghost_pad_new_no_target :: ((Ptr CChar) -> (CInt -> (IO (Ptr Pad))))
foreign import ccall safe "gst_ghost_pad_new_from_template"
gst_ghost_pad_new_from_template :: ((Ptr CChar) -> ((Ptr Pad) -> ((Ptr PadTemplate) -> (IO (Ptr Pad)))))
foreign import ccall safe "gst_ghost_pad_new_no_target_from_template"
gst_ghost_pad_new_no_target_from_template :: ((Ptr CChar) -> ((Ptr PadTemplate) -> (IO (Ptr Pad))))
foreign import ccall safe "gst_ghost_pad_set_target"
gst_ghost_pad_set_target :: ((Ptr GhostPad) -> ((Ptr Pad) -> (IO CInt)))
foreign import ccall safe "gst_ghost_pad_get_target"
gst_ghost_pad_get_target :: ((Ptr GhostPad) -> (IO (Ptr Pad)))