33 #define ID_STRING "nut/multimedia container"
34 #define ID_LENGTH (strlen(ID_STRING) + 1)
38 nut_stream_header_tt *
s;
48 #if CONFIG_LIBNUT_MUXER
49 static int av_write(
void * h,
size_t len,
const uint8_t * buf) {
59 nut_muxer_opts_tt mopts = {
67 .max_distance = 32768,
70 nut_stream_header_tt * s;
79 int num, denom, ssize;
93 for (j = 0; j < s[i].fourcc_len; j++) s[i].fourcc[j] = (fourcc >> (j*8)) & 0xFF;
98 s[i].time_base.num = denom;
99 s[i].time_base.den = num;
107 s[i].width = codec->
width;
108 s[i].height = codec->
height;
109 s[i].sample_width = 0;
110 s[i].sample_height = 0;
111 s[i].colorspace_type = 0;
114 s[i].samplerate_denom = 1;
115 s[i].channel_count = codec->
channels;
120 priv->
nut = nut_muxer_init(&mopts, s,
NULL);
135 nut_write_frame_reorder(priv->
nut, &p, pkt->
data);
145 nut_muxer_uninit_reorder(priv->
nut);
148 for(i = 0; priv->
s[i].type != -1; i++ )
av_freep(&priv->
s[i].fourcc);
156 .long_name =
"nut format",
157 .mime_type =
"video/x-nut",
180 static off_t
av_seek(
void * h,
long long pos,
int whence) {
182 if (whence == SEEK_END) {
192 nut_demuxer_opts_tt dopts = {
202 .cache_syncpoints = 1,
204 nut_context_tt * nut = priv->
nut = nut_demuxer_init(&dopts);
205 nut_stream_header_tt * s;
208 if ((ret = nut_read_headers(nut, &s,
NULL))) {
210 nut_demuxer_uninit(nut);
216 for (i = 0; s[i].type != -1 && i < 2; i++) {
220 for (j = 0; j < s[i].fourcc_len && j < 8; j++) st->
codec->
codec_tag |= s[i].fourcc[j]<<(j*8);
237 case NUT_AUDIO_CLASS:
244 case NUT_VIDEO_CLASS:
265 ret = nut_read_next_packet(priv->
nut, &pd);
268 if (ret != NUT_ERR_EOF)
278 ret = nut_read_frame(priv->
nut, &pd.len, pkt->
data);
285 int active_streams[] = { stream_index, -1 };
286 double time_pos = target_ts * priv->
s[stream_index].time_base.num / (double)priv->
s[stream_index].time_base.den;
296 nut_demuxer_uninit(priv->
nut);