Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. #ifndef PLAYER_H
  2. #define PLAYER_H
  3.  
  4. #include <gst/gst.h>
  5. #include <glib.h>
  6. #include <string.h>
  7. #include <stdarg.h>
  8.  
  9. /**
  10. * a node represents the head of a group of linked GstElements
  11. */
  12. typedef GstElement* node_t;
  13.  
  14. /**
  15. * this contains the main variables of a player
  16. */
  17. typedef struct player_t{
  18. GMainLoop *loop;
  19. GstElement *pipeline;
  20. node_t video_node;
  21. node_t audio_node;
  22. gboolean paused;
  23. gboolean subtitles;
  24. } Player;
  25.  
  26. /**
  27. * creates a gst element, links it to the Player p,
  28. * prints error and exits on error
  29. */
  30. GstElement * make_element(Player * p, const char * elem_name, const char * name);
  31.  
  32. /**
  33. * does the same thing than gst_element_link_many,
  34. * but the last linked element is returned
  35. */
  36. node_t v_gst_element_link_many(GstElement * elem, va_list args);
  37.  
  38. /**
  39. * creates a node from a file source,
  40. * links all added elements to the Player p
  41. */
  42. node_t file_node(Player * p, const char * filename, ...);
  43.  
  44. /**
  45. * creates a node from a demuxer source
  46. */
  47. node_t demux_node(node_t demuxer, GstElement * elem, ...);
  48.  
  49. /**
  50. * creates a node from 2 muxed nodes as source
  51. */
  52. node_t mux_node(node_t node1, node_t node2, GstElement * elem, ...);
  53.  
  54. /**
  55. * links 2 elements contained in the player
  56. */
  57. void link_element(Player * p, const char * src, const char * dst);
  58.  
  59. /**
  60. * unlinks 2 elements contained in the player
  61. */
  62. void unlink_element(Player * p, const char * src, const char * dst);
  63.  
  64. /**
  65. * returns the expected name of the subtitles file of a video file
  66. * remember to free the returned String
  67. */
  68. char * get_sub_name(char * video_filename);
  69.  
  70. /**
  71. * Player constructor
  72. */
  73. Player * player_init();
  74.  
  75. /**
  76. * clean the allocated resources
  77. */
  78. void player_clean(Player * p);
  79.  
  80. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement