libavformat/seek.h File Reference

#include "avformat.h"

Go to the source code of this file.

Data Structures

struct  AVParserStreamState
 structure to store parser state of one AVStream More...
struct  AVParserState
 structure to store parser state of AVFormat More...

Functions

int64_t ff_gen_syncpoint_search (AVFormatContext *s, int stream_index, int64_t pos, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 Search for the sync point of all active streams.
AVParserStateff_store_parser_state (AVFormatContext *s)
 Store current parser state and file position.
void ff_restore_parser_state (AVFormatContext *s, AVParserState *state)
 Restore previously saved parser state and file position.
void ff_free_parser_state (AVFormatContext *s, AVParserState *state)
 Free previously saved parser state.


Function Documentation

void ff_free_parser_state ( AVFormatContext s,
AVParserState state 
)

Free previously saved parser state.

Parameters:
s context to which the state belongs (same as used for storing state)
state state to free

Definition at line 498 of file seek.c.

int64_t ff_gen_syncpoint_search ( AVFormatContext s,
int  stream_index,
int64_t  pos,
int64_t  min_ts,
int64_t  ts,
int64_t  max_ts,
int  flags 
)

Search for the sync point of all active streams.

This routine is not supposed to be called directly by a user application, but by demuxers.

A sync point is defined as a point in stream, such that, when decoding start from this point, the decoded output of all streams synchronizes closest to the given timestamp ts. This routine also takes timestamp limits into account. Thus, the output will synchronize no sooner than ts_min and no later than ts_max.

Parameters:
stream_index stream index for time base reference of timestamps
pos approximate position where to start searching for key frames
min_ts minimum allowed timestamp (position, if AVSEEK_FLAG_BYTE set)
ts target timestamp (or position, if AVSEEK_FLAG_BYTE set in flags)
max_ts maximum allowed timestamp (position, if AVSEEK_FLAG_BYTE set)
flags if AVSEEK_FLAG_ANY is set, seek to any frame, otherwise only to a keyframe. If AVSEEK_FLAG_BYTE is set, search by position, not by timestamp.
Returns:
-1 if no such sync point could be found, otherwise stream position (stream is repositioned to this position)

Definition at line 244 of file seek.c.

void ff_restore_parser_state ( AVFormatContext s,
AVParserState state 
)

Restore previously saved parser state and file position.

Saved state will be invalidated and freed by this call, since internal structures will be relinked back to the stored state instead of being deeply-copied.

Parameters:
s context to which to restore state (same as used for storing state)
state state to restore

Definition at line 450 of file seek.c.

AVParserState* ff_store_parser_state ( AVFormatContext s  ) 

Store current parser state and file position.

This function can be used by demuxers before a destructive seeking algorithm to store the parser state. Depending on the outcome of the seek, either the original state can be restored or the new state kept and the original state freed.

Note:
As a side effect, the original parser state is reset, since structures are relinked to the stored state instead of being deeply-copied (for performance reasons and to keep the code simple).
Parameters:
s context from which to save state
Returns:
parser state object or NULL if memory could not be allocated

Definition at line 394 of file seek.c.


Generated on Fri Oct 26 02:46:13 2012 for FFmpeg by  doxygen 1.5.8