Revision ff1ec0c3

View differences:

libavformat/asfdec.c
1242 1242

  
1243 1243
    /* Try using the protocol's read_seek if available */
1244 1244
    if(s->pb) {
1245
        int ret = ffio_read_seek(s->pb, stream_index, pts, flags);
1245
        int ret = avio_seek_time(s->pb, stream_index, pts, flags);
1246 1246
        if(ret >= 0)
1247 1247
            asf_reset_header(s);
1248 1248
        if (ret != AVERROR(ENOSYS))
libavformat/avio.h
617 617
 */
618 618
const char *avio_enum_protocols(void **opaque, int output);
619 619

  
620
/**
621
 * Pause and resume playing - only meaningful if using a network streaming
622
 * protocol (e.g. MMS).
623
 * @param pause 1 for pause, 0 for resume
624
 */
625
int     avio_pause(AVIOContext *h, int pause);
626

  
627
/**
628
 * Seek to a given timestamp relative to some component stream.
629
 * Only meaningful if using a network streaming protocol (e.g. MMS.).
630
 * @param stream_index The stream index that the timestamp is relative to.
631
 *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
632
 *        units from the beginning of the presentation.
633
 *        If a stream_index >= 0 is used and the protocol does not support
634
 *        seeking based on component streams, the call will fail with ENOTSUP.
635
 * @param timestamp timestamp in AVStream.time_base units
636
 *        or if there is no stream specified then in AV_TIME_BASE units.
637
 * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
638
 *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
639
 *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
640
 *        fail with ENOTSUP if used and not supported.
641
 * @return >= 0 on success
642
 * @see AVInputFormat::read_seek
643
 */
644
int64_t avio_seek_time(AVIOContext *h, int stream_index,
645
                       int64_t timestamp, int flags);
646

  
620 647
#endif /* AVFORMAT_AVIO_H */
libavformat/avio_internal.h
67 67
/** @warning must be called before any I/O */
68 68
int ffio_set_buf_size(AVIOContext *s, int buf_size);
69 69

  
70
/**
71
 * Pause and resume playing - only meaningful if using a network streaming
72
 * protocol (e.g. MMS).
73
 * @param pause 1 for pause, 0 for resume
74
 */
75
int     ffio_read_pause(AVIOContext *h,    int pause);
76
/**
77
 * Seek to a given timestamp relative to some component stream.
78
 * Only meaningful if using a network streaming protocol (e.g. MMS.).
79
 * @param stream_index The stream index that the timestamp is relative to.
80
 *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
81
 *        units from the beginning of the presentation.
82
 *        If a stream_index >= 0 is used and the protocol does not support
83
 *        seeking based on component streams, the call will fail with ENOTSUP.
84
 * @param timestamp timestamp in AVStream.time_base units
85
 *        or if there is no stream specified then in AV_TIME_BASE units.
86
 * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
87
 *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
88
 *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
89
 *        fail with ENOTSUP if used and not supported.
90
 * @return >= 0 on success
91
 * @see AVInputFormat::read_seek
92
 */
93
int64_t ffio_read_seek (AVIOContext *h,    int stream_index,
94
                        int64_t timestamp, int flags);
95

  
96 70
void ffio_init_checksum(AVIOContext *s,
97 71
                        unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
98 72
                        unsigned long checksum);
libavformat/aviobuf.c
403 403
}
404 404
int av_url_read_fpause(AVIOContext *s, int pause)
405 405
{
406
    return ffio_read_pause(s, pause);
406
    return avio_pause(s, pause);
407 407
}
408 408
int64_t av_url_read_fseek(AVIOContext *s, int stream_index,
409 409
                         int64_t timestamp, int flags)
410 410
{
411
    return ffio_read_seek(s, stream_index, timestamp, flags);
411
    return avio_seek_time(s, stream_index, timestamp, flags);
412 412
}
413 413
void init_checksum(AVIOContext *s,
414 414
                   unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
......
1013 1013
}
1014 1014
#endif
1015 1015

  
1016
int ffio_read_pause(AVIOContext *s, int pause)
1016
int avio_pause(AVIOContext *s, int pause)
1017 1017
{
1018 1018
    if (!s->read_pause)
1019 1019
        return AVERROR(ENOSYS);
1020 1020
    return s->read_pause(s->opaque, pause);
1021 1021
}
1022 1022

  
1023
int64_t ffio_read_seek(AVIOContext *s, int stream_index,
1023
int64_t avio_seek_time(AVIOContext *s, int stream_index,
1024 1024
                       int64_t timestamp, int flags)
1025 1025
{
1026 1026
    URLContext *h = s->opaque;
libavformat/flvdec.c
529 529
static int flv_read_seek(AVFormatContext *s, int stream_index,
530 530
    int64_t ts, int flags)
531 531
{
532
    return ffio_read_seek(s->pb, stream_index, ts, flags);
532
    return avio_seek_time(s->pb, stream_index, ts, flags);
533 533
}
534 534

  
535 535
#if 0 /* don't know enough to implement this */
......
550 550
            ts = av_rescale_rnd(ts, 1000, AV_TIME_BASE,
551 551
                flags & AVSEEK_FLAG_BACKWARD ? AV_ROUND_DOWN : AV_ROUND_UP);
552 552
        }
553
        ret = ffio_read_seek(s->pb, stream_index, ts, flags);
553
        ret = avio_seek_time(s->pb, stream_index, ts, flags);
554 554
    }
555 555

  
556 556
    if (ret == AVERROR(ENOSYS))
libavformat/utils.c
2579 2579
    if (s->iformat->read_play)
2580 2580
        return s->iformat->read_play(s);
2581 2581
    if (s->pb)
2582
        return ffio_read_pause(s->pb, 0);
2582
        return avio_pause(s->pb, 0);
2583 2583
    return AVERROR(ENOSYS);
2584 2584
}
2585 2585

  
......
2588 2588
    if (s->iformat->read_pause)
2589 2589
        return s->iformat->read_pause(s);
2590 2590
    if (s->pb)
2591
        return ffio_read_pause(s->pb, 1);
2591
        return avio_pause(s->pb, 1);
2592 2592
    return AVERROR(ENOSYS);
2593 2593
}
2594 2594

  

Also available in: Unified diff