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 AVPacket cur_pkt; 00035 int64_t last_IP_pts; 00036 int64_t cur_dts; 00037 int64_t reference_dts; 00038 const uint8_t *cur_ptr; 00039 int cur_len; 00040 int probe_packets; 00041 } AVParserStreamState; 00042 00046 typedef struct AVParserState { 00047 int64_t fpos; 00048 00049 // saved members of AVFormatContext 00050 AVStream *cur_st; 00051 AVPacketList *packet_buffer; 00052 AVPacketList *raw_packet_buffer; 00053 int raw_packet_buffer_remaining_size; 00054 00055 // saved info for streams 00056 int nb_streams; 00057 AVParserStreamState *stream_states; 00058 } AVParserState; 00059 00082 int64_t ff_gen_syncpoint_search(AVFormatContext *s, 00083 int stream_index, 00084 int64_t pos, 00085 int64_t min_ts, 00086 int64_t ts, 00087 int64_t max_ts, 00088 int flags); 00089 00104 AVParserState *ff_store_parser_state(AVFormatContext *s); 00105 00116 void ff_restore_parser_state(AVFormatContext *s, AVParserState *state); 00117 00124 void ff_free_parser_state(AVFormatContext *s, AVParserState *state); 00125 00126 #endif /* AVFORMAT_SEEK_H */