Media.Streaming.GStreamer.Core.Init

1
2
3
4
5
6
7
8
9
10
11
12
initWithArgs :: IO ()
initWithArgs = do
              args <- (:) <$> getProgName <*> getArgs
              let argc = length args
              str  <- mapM newCString args
              alloca$ \argcPtr ->
                  allocaArray argc $ \argvPtr ->
                     do
                      poke argcPtr (fromIntegral argc)
                      pokeArray argvPtr str
                      argvPtrPtr <- new argvPtr
                      {# call init #} argcPtr argvPtrPtr