| GStreamer 0.10 Library Reference Manual |
|---|
GstBaseSrcGstBaseSrc — |
#include <gst/base/gstbasesrc.h>
GstBaseSrc;
GstBaseSrcClass;
enum GstBaseSrcFlags;
gboolean gst_base_src_is_live (GstBaseSrc *src);
void gst_base_src_set_live (GstBaseSrc *src,
gboolean live);
void gst_base_src_set_format (GstBaseSrc *src,
GstFormat format);
#define GST_BASE_SRC_PAD (obj)
typedef struct {
GstElementClass parent_class;
/* virtual methods for subclasses */
/* get caps from subclass */
GstCaps* (*get_caps) (GstBaseSrc *src);
/* notify the subclass of new caps */
gboolean (*set_caps) (GstBaseSrc *src, GstCaps *caps);
/* decide on caps */
gboolean (*negotiate) (GstBaseSrc *src);
/* generate and send a newsegment */
gboolean (*newsegment) (GstBaseSrc *src);
/* start and stop processing, ideal for opening/closing the resource */
gboolean (*start) (GstBaseSrc *src);
gboolean (*stop) (GstBaseSrc *src);
/* given a buffer, return start and stop time when it should be pushed
* out. The base class will sync on the clock using these times. */
void (*get_times) (GstBaseSrc *src, GstBuffer *buffer,
GstClockTime *start, GstClockTime *end);
/* get the total size of the resource in bytes */
gboolean (*get_size) (GstBaseSrc *src, guint64 *size);
/* check if the resource is seekable */
gboolean (*is_seekable) (GstBaseSrc *src);
/* unlock any pending access to the resource. subclasses should unlock
* any function ASAP. */
gboolean (*unlock) (GstBaseSrc *src);
/* notify subclasses of an event */
gboolean (*event) (GstBaseSrc *src, GstEvent *event);
/* ask the subclass to create a buffer with offset and size */
GstFlowReturn (*create) (GstBaseSrc *src, guint64 offset, guint size,
GstBuffer **buf);
/* additions that change padding... */
/* notify subclasses of a seek */
gboolean (*do_seek) (GstBaseSrc *src, GstSegment *segment);
/* notify subclasses of a query */
gboolean (*query) (GstBaseSrc *src, GstQuery *query);
/* check whether the source would support pull-based operation if
* it were to be opened now. This vfunc is optional, but should be
* implemented if possible to avoid unnecessary start/stop cycles.
* The default implementation will open and close the resource to
* find out whether get_range is supported and that is usually
* undesirable. */
gboolean (*check_get_range) (GstBaseSrc *src);
} GstBaseSrcClass;
GstElementClass parent_class; | Element parent class |
get_caps () | Called to get the caps to report |
set_caps () | Notify subclass of changed output caps |
negotiate () | Negotiated the caps with the peer. |
newsegment () | Generate and send a new_segment event. |
start () | Start processing. Subclasses should open resources and prepare to produce data. |
stop () | Stop processing. Subclasses should use this to close resources. |
get_times () | Given a buffer, return the start and stop time when it should be pushed out. The base class will sync on the clock using these times. |
get_size () | Return the total size of the resource, in the configured format. |
is_seekable () | Check if the source can seek |
unlock () | Unlock any pending access to the resource. Subclasses should unblock any blocked function ASAP |
event () | Override this to implement custom event handling. |
create () | Ask the subclass to create a buffer with offset and size. |
do_seek () | Perform seeking on the resource to the indicated segment. |
query () | Handle a requested query. |
check_get_range () | Check whether the source would support pull-based operation if it were to be opened now. This vfunc is optional, but should be implemented if possible to avoid unnecessary start/stop cycles. The default implementation will open and close the resource to find out whether get_range is supported, and that is usually undesirable. |
typedef enum {
GST_BASE_SRC_STARTED = (GST_ELEMENT_FLAG_LAST << 0),
/* padding */
GST_BASE_SRC_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2)
} GstBaseSrcFlags;
The GstElement flags that a basesrc element may have.
GST_BASE_SRC_STARTED | has source been started |
GST_BASE_SRC_FLAG_LAST | offset to define more flags |
gboolean gst_base_src_is_live (GstBaseSrc *src);
Check if an element is in live mode.
src : | base source instance |
| Returns : | TRUE if element is in live mode.
|
void gst_base_src_set_live (GstBaseSrc *src, gboolean live);
If the element listens to a live source, the livemode should
be set to TRUE. This declares that this source can't seek.
src : | base source instance |
live : | new live-mode |
void gst_base_src_set_format (GstBaseSrc *src, GstFormat format);
Sets the default format of the source. This will be the format used for sending NEW_SEGMENT events and for performing seeks.
If a format of GST_FORMAT_BYTES is set, the element will be able to operate in pull mode if the GstBaseSrc::is_seekable returns TRUE.
Since: 0.10.1
src : | base source instance |
format : | the format to use |
#define GST_BASE_SRC_PAD(obj) (GST_BASE_SRC_CAST (obj)->srcpad)
Gives the pointer to the GstPad object of the element.
obj : | base source instance |
| << GStreamer Base and Utillity Classes | GstBaseSink >> |