| 27 | #include "rawenc.h" |
| 28 | |
| 29 | static int a64_write_header(AVFormatContext *s) |
| 30 | { |
| 31 | AVCodecParameters *par = s->streams[0]->codecpar; |
| 32 | uint8_t header[5] = { |
| 33 | 0x00, //load |
| 34 | 0x40, //address |
| 35 | 0x00, //mode |
| 36 | 0x00, //charset_lifetime (multi only) |
| 37 | 0x00 //fps in 50/fps; |
| 38 | }; |
| 39 | |
| 40 | if (par->extradata_size < 4) { |
| 41 | av_log(s, AV_LOG_ERROR, "Missing extradata\n"); |
| 42 | return AVERROR_INVALIDDATA; |
| 43 | } |
| 44 | |
| 45 | switch (par->codec_id) { |
| 46 | case AV_CODEC_ID_A64_MULTI: |
| 47 | header[2] = 0x00; |
| 48 | header[3] = AV_RB32(par->extradata+0); |
| 49 | header[4] = 2; |
| 50 | break; |
| 51 | case AV_CODEC_ID_A64_MULTI5: |
| 52 | header[2] = 0x01; |
| 53 | header[3] = AV_RB32(par->extradata+0); |
| 54 | header[4] = 3; |
| 55 | break; |
| 56 | default: |
| 57 | return AVERROR_INVALIDDATA; |
| 58 | } |
| 59 | avio_write(s->pb, header, 2); |
| 60 | return 0; |
| 61 | } |
| 62 | |
| 63 | const FFOutputFormat ff_a64_muxer = { |
| 64 | .p.name = "a64", |
nothing calls this directly
no test coverage detected