Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PLAYER_H
- #define PLAYER_H
- #include <gst/gst.h>
- #include <glib.h>
- #include <string.h>
- #include <stdarg.h>
- /**
- * a node represents the head of a group of linked GstElements
- */
- typedef GstElement* node_t;
- /**
- * this contains the main variables of a player
- */
- typedef struct player_t{
- GMainLoop *loop;
- GstElement *pipeline;
- node_t video_node;
- node_t audio_node;
- gboolean paused;
- gboolean subtitles;
- } Player;
- /**
- * creates a gst element, links it to the Player p,
- * prints error and exits on error
- */
- GstElement * make_element(Player * p, const char * elem_name, const char * name);
- /**
- * does the same thing than gst_element_link_many,
- * but the last linked element is returned
- */
- node_t v_gst_element_link_many(GstElement * elem, va_list args);
- /**
- * creates a node from a file source,
- * links all added elements to the Player p
- */
- node_t file_node(Player * p, const char * filename, ...);
- /**
- * creates a node from a demuxer source
- */
- node_t demux_node(node_t demuxer, GstElement * elem, ...);
- /**
- * creates a node from 2 muxed nodes as source
- */
- node_t mux_node(node_t node1, node_t node2, GstElement * elem, ...);
- /**
- * links 2 elements contained in the player
- */
- void link_element(Player * p, const char * src, const char * dst);
- /**
- * unlinks 2 elements contained in the player
- */
- void unlink_element(Player * p, const char * src, const char * dst);
- /**
- * returns the expected name of the subtitles file of a video file
- * remember to free the returned String
- */
- char * get_sub_name(char * video_filename);
- /**
- * Player constructor
- */
- Player * player_init();
- /**
- * clean the allocated resources
- */
- void player_clean(Player * p);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement