home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / LINUX / gopchop-1.1.7.tar.tar / gopchop-1.1.7.tar / gopchop-1.1.7 / src / display.h < prev    next >
C/C++ Source or Header  |  2005-04-30  |  3KB  |  115 lines

  1. /*
  2. #
  3. # Headers for the generic display subsystem
  4. #
  5. # $Id: display.h,v 1.3 2005/04/30 10:01:00 keescook Exp $
  6. #
  7. # Copyright (C) 2004,2005 Kees Cook
  8. # kees@outflux.net, http://outflux.net/
  9. # This program is free software; you can redistribute it and/or
  10. # modify it under the terms of the GNU General Public License
  11. # as published by the Free Software Foundation; either version 2
  12. # of the License, or (at your option) any later version.
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20. # http://www.gnu.org/copyleft/gpl.html
  21. #
  22. */
  23. #ifndef _DISPLAY_H_
  24. #define _DISPLAY_H_
  25.  
  26. #include "GOPchop.h"
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #include "video_out.h"
  33. #include <mpeg2dec/mpeg2.h>
  34.  
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38.  
  39. #include <gdk/gdkx.h>
  40.  
  41. #include "GroupOfPictures.h"
  42.  
  43. #define GOPCHOP_OUTPUT_LIBVO 0
  44. #define GOPCHOP_OUTPUT_PIPE  1
  45.  
  46. struct display_engine_t {
  47.     int              opt_show_states;
  48.     mpeg2dec_t      *mpeg2dec;
  49.     const mpeg2_info_t *parser_info;
  50.  
  51.     int             desired_output;
  52.  
  53.     // FIXME: these two sections should be a union
  54.  
  55.     // libvo output
  56.     vo_instance_t   *output;
  57.     GdkWindow       *frame_window;
  58.  
  59.     // pipe output
  60.     int pipes[2];
  61.     int *client_pipe;
  62.  
  63.  
  64.     GroupOfPictures *GOP;
  65.  
  66.     int              last_valid;    // is the "last" stuff valid?
  67.     uint32_t         last_group;    // last group sent to decoder
  68.     int              last_flushed;  // did the last group get flushed?
  69. };
  70.  
  71. // display a specific frame from the given gop. frame<0 means last frame
  72. void display_frame(struct display_engine_t * engine,
  73.                    uint32_t group, int frame);
  74.  
  75. // display each frame of the requested GOP.
  76. // if the "last_group" preceeds this one, and it wasn't "last_flushed",
  77. // then we can safely continue displaying this GOP.
  78. void display_gop  (struct display_entine_t * engine,
  79.                    uint32_t group, int flush_end);
  80.  
  81. // returns NULL on failure, or an init'd structure that caller must free
  82. struct display_engine_t * display_open(
  83.                    int desired_output,
  84.                    char * opt_output_arg,
  85.                    char * opt_videoout,
  86.                    int opt_show_states);
  87. // closes and unallocated all stuff
  88. void display_close(struct display_engine_t * engine);
  89.  
  90. // hooks up a group of pictures (use NULL to unhook)
  91. void display_hookup_gop(struct display_engine_t * engine,
  92.                         GroupOfPictures *GOP);
  93.  
  94. // is this window the display window?
  95. bool display_is_window(struct display_engine_t * engine,
  96.                        GdkWindow * window);
  97.  
  98. // redraw the display
  99. void display_redraw(struct display_engine_t * engine);
  100.  
  101. // flush the pictures
  102. void display_flush(struct display_engine_t * engine);
  103.  
  104. // temporary
  105. void show_GOP(struct display_engine_t * engine, uint32_t wantedGOP);
  106.  
  107. // extra
  108. vo_open_t * find_libvo_driver(char * desired_driver);
  109.  
  110. #endif /* _DISPLAY_H_ */
  111. /* vi:set ai ts=4 sw=4 expandtab: */
  112.