Exemple #1
0
static int framemd5_write_header(struct AVFormatContext *s)
{
    struct MD5Context *c = s->priv_data;
    int res = av_hash_alloc(&c->hash, c->hash_name);
    if (res < 0)
        return res;
    return ff_framehash_write_header(s);
}
Exemple #2
0
static int framemd5_write_header(struct AVFormatContext *s)
{
    struct MD5Context *c = s->priv_data;
    c->md5 = av_md5_alloc();
    if (!c->md5)
        return AVERROR(ENOMEM);
    return ff_framehash_write_header(s);
}
Exemple #3
0
static int framehash_write_header(struct AVFormatContext *s)
{
    struct HashContext *c = s->priv_data;
    int res = av_hash_alloc(&c->hash, c->hash_name);
    if (res < 0)
        return res;
    avio_printf(s->pb, "#format: frame checksums\n");
    avio_printf(s->pb, "#version: %d\n", c->format_version);
    avio_printf(s->pb, "#hash: %s\n", av_hash_get_name(c->hash));
    ff_framehash_write_header(s, c->format_version);
    avio_printf(s->pb, "#stream#, dts,        pts, duration,     size, hash\n");
    return 0;
}
Exemple #4
0
static int framecrc_write_header(struct AVFormatContext *s)
{
    int i;
    for (i = 0; i < s->nb_streams; i++) {
        AVStream *st = s->streams[i];
        AVCodecContext *avctx = st->codec;
        if (avctx->extradata) {
            uint32_t crc = av_adler32_update(0, avctx->extradata, avctx->extradata_size);
            avio_printf(s->pb, "#extradata %d: %8d, 0x%08"PRIx32"\n",
                        i, avctx->extradata_size, crc);
        }
    }

    return ff_framehash_write_header(s);
}