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;
81 int num, denom, ssize;
95 for (j = 0; j < s[i].fourcc_len; j++) s[i].fourcc[j] = (fourcc >> (j*8)) & 0xFF;
100 s[i].time_base.num = denom;
101 s[i].time_base.den = num;
109 s[i].width = codec->
width;
110 s[i].height = codec->
height;
111 s[i].sample_width = 0;
112 s[i].sample_height = 0;
113 s[i].colorspace_type = 0;
116 s[i].samplerate_denom = 1;
117 s[i].channel_count = codec->
channels;
122 priv->
nut = nut_muxer_init(&mopts, s, NULL);
137 nut_write_frame_reorder(priv->
nut, &p, pkt->
data);
147 nut_muxer_uninit_reorder(priv->
nut);
150 for(i = 0; priv->
s[i].type != -1; i++ )
av_freep(&priv->
s[i].fourcc);
158 .long_name =
"nut format",
159 .mime_type =
"video/x-nut",
182 static off_t
av_seek(
void * h,
long long pos,
int whence) {
184 if (whence == SEEK_END) {
194 nut_demuxer_opts_tt dopts = {
204 .cache_syncpoints = 1,
206 nut_context_tt * nut = priv->
nut = nut_demuxer_init(&dopts);
207 nut_stream_header_tt *
s;
213 if ((ret = nut_read_headers(nut, &s, NULL))) {
215 nut_demuxer_uninit(nut);
222 for (i = 0; s[i].type != -1 && i < 2; i++) {
229 for (j = 0; j < s[i].fourcc_len && j < 8; j++) st->
codec->
codec_tag |= s[i].fourcc[j]<<(j*8);
236 nut_demuxer_uninit(nut);
250 case NUT_AUDIO_CLASS:
257 case NUT_VIDEO_CLASS:
278 ret = nut_read_next_packet(priv->
nut, &pd);
281 if (ret != NUT_ERR_EOF)
291 ret = nut_read_frame(priv->
nut, &pd.len, pkt->
data);
298 int active_streams[] = { stream_index, -1 };
299 double time_pos = target_ts * priv->
s[stream_index].time_base.num / (double)priv->
s[stream_index].time_base.den;
309 nut_demuxer_uninit(priv->
nut);