00001 /* 00002 * seek utility functions for use within format handlers 00003 * 00004 * Copyright (c) 2009 Ivan Schreter 00005 * 00006 * This file is part of FFmpeg. 00007 * 00008 * FFmpeg is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * FFmpeg is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with FFmpeg; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 #ifndef AVFORMAT_SEEK_H 00024 #define AVFORMAT_SEEK_H 00025 00026 #include "avformat.h" 00027 00031 typedef struct AVParserStreamState { 00032 // saved members of AVStream 00033 AVCodecParserContext *parser; 00034 int64_t last_IP_pts; 00035 int64_t cur_dts; 00036 int64_t reference_dts; 00037 int probe_packets; 00038 } AVParserStreamState; 00039 00043 typedef struct AVParserState { 00044 int64_t fpos; 00045 00046 // saved members of AVFormatContext 00047 AVPacketList *packet_buffer; 00048 AVPacketList *parse_queue; 00049 AVPacketList *raw_packet_buffer; 00050 int raw_packet_buffer_remaining_size; 00051 00052 // saved info for streams 00053 int nb_streams; 00054 AVParserStreamState *stream_states; 00055 } AVParserState; 00056 00079 int64_t ff_gen_syncpoint_search(AVFormatContext *s, 00080 int stream_index, 00081 int64_t pos, 00082 int64_t min_ts, 00083 int64_t ts, 00084 int64_t max_ts, 00085 int flags); 00086 00101 AVParserState *ff_store_parser_state(AVFormatContext *s); 00102 00113 void ff_restore_parser_state(AVFormatContext *s, AVParserState *state); 00114 00121 void ff_free_parser_state(AVFormatContext *s, AVParserState *state); 00122 00123 #endif /* AVFORMAT_SEEK_H */