## directdrawsink directdrawsink — Direct Draw video sink |

## Synopsis

                        GstDirectDrawSink;

## Description

DirectdrawSink renders video RGB frames to any win32 window. This element can receive a window ID from the application through the XOverlay interface and will then render video frames in this window. If no Window ID was provided by the application, the element will create its own internal window and render into it.

### Example pipelines

    1
    gst-launch -v videotestsrc ! directdrawsink

a simple pipeline to test the sink

## Details

### GstDirectDrawSink

    typedef struct {
      GstVideoSink videosink;

      /* directdraw offscreen surfaces pool */
      GSList *buffer_pool;
      GMutex *pool_lock;

      /* directdraw objects */
      LPDIRECTDRAW ddraw_object;
      LPDIRECTDRAWSURFACE primary_surface;
      LPDIRECTDRAWSURFACE offscreen_surface;
      LPDIRECTDRAWCLIPPER clipper;

      /* last buffer displayed (used for XOverlay interface expose method) */
      GstBuffer * last_buffer;

      /* directdraw caps */
      GstCaps *caps;

      /* video window management */
      HWND video_window;
      gboolean our_video_window;
      HANDLE window_created_signal;

      /* video properties */
      gint video_width, video_height;
      gint out_width, out_height;
      gint fps_n;
      gint fps_d;

      /* properties */
      gboolean keep_aspect_ratio;

      /*pixel format */
      DDPIXELFORMAT dd_pixel_format;

      /* thread processing our default window messages */
      GThread *window_thread;

      /* TRUE when directdraw object is set up */
      gboolean setup;

      /* TRUE if the hardware supports blitting from one colorspace to another */
      gboolean can_blit_between_colorspace;

      /* This flag is used to force re-creation of our offscreen surface.
       * It's needed when hardware doesn't support fourcc blit and the bit depth
       * of the current display mode changes.
       */
      gboolean must_recreate_offscreen;
    } GstDirectDrawSink;