Lines Matching defs:avctx
79 static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, unsigned size)
94 av_dict_set(&avctx->metadata, tag, value, AV_DICT_DONT_STRDUP_VAL);
97 static void read_uint8(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
99 av_dict_set_int(&avctx->metadata, tag, avio_r8(pb), 0);
102 static void read_uint16(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
104 av_dict_set_int(&avctx->metadata, tag, avio_rl16(pb), 0);
107 static void read_uint32(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
109 av_dict_set_int(&avctx->metadata, tag, avio_rl32(pb), 0);
112 static void read_uint64(AVFormatContext *avctx, AVIOContext *pb, const char *tag, const char *fmt)
114 av_dict_set_int(&avctx->metadata, tag, avio_rl64(pb), 0);
117 static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int file)
120 MlvContext *mlv = avctx->priv_data;
136 ret = av_image_check_size(width, height, 0, avctx);
140 avpriv_request_sample(avctx, "raw api version");
144 av_log(avctx, AV_LOG_ERROR,
154 avpriv_request_sample(avctx, "cfa_pattern");
160 ret = ff_get_wav_header(avctx, pb, ast->codecpar, 16, 0);
166 read_string(avctx, pb, "info", size);
169 read_string(avctx, pb, "cameraName", 32);
170 read_uint32(avctx, pb, "cameraModel", "0x%"PRIx32);
173 read_string(avctx, pb, "cameraSerial", 32);
177 read_uint16(avctx, pb, "focalLength", "%i");
178 read_uint16(avctx, pb, "focalDist", "%i");
179 read_uint16(avctx, pb, "aperture", "%i");
180 read_uint8(avctx, pb, "stabilizerMode", "%i");
181 read_uint8(avctx, pb, "autofocusMode", "%i");
182 read_uint32(avctx, pb, "flags", "0x%"PRIx32);
183 read_uint32(avctx, pb, "lensID", "%"PRIi32);
184 read_string(avctx, pb, "lensName", 32);
187 read_string(avctx, pb, "lensSerial", 32);
203 read_uint32(avctx, pb, "wb_mode", "%"PRIi32);
204 read_uint32(avctx, pb, "kelvin", "%"PRIi32);
205 read_uint32(avctx, pb, "wbgain_r", "%"PRIi32);
206 read_uint32(avctx, pb, "wbgain_g", "%"PRIi32);
207 read_uint32(avctx, pb, "wbgain_b", "%"PRIi32);
208 read_uint32(avctx, pb, "wbs_gm", "%"PRIi32);
209 read_uint32(avctx, pb, "wbs_ba", "%"PRIi32);
225 av_dict_set(&avctx->metadata, "time", str, 0);
228 av_dict_set(&avctx->metadata, "isoMode", avio_rl32(pb) ? "auto" : "manual", 0);
229 read_uint32(avctx, pb, "isoValue", "%"PRIi32);
230 read_uint32(avctx, pb, "isoAnalog", "%"PRIi32);
231 read_uint32(avctx, pb, "digitalGain", "%"PRIi32);
234 read_uint64(avctx, pb, "shutterValue", "%"PRIi64);
238 read_uint32(avctx, pb, "picStyleId", "%"PRIi32);
239 read_uint32(avctx, pb, "contrast", "%"PRIi32);
240 read_uint32(avctx, pb, "sharpness", "%"PRIi32);
241 read_uint32(avctx, pb, "saturation", "%"PRIi32);
242 read_uint32(avctx, pb, "colortone", "%"PRIi32);
243 read_string(avctx, pb, "picStyleName", 16);
249 av_log(avctx, AV_LOG_INFO, "unsupported tag %s, size %u\n",
257 static int read_header(AVFormatContext *avctx)
259 MlvContext *mlv = avctx->priv_data;
260 AVIOContext *pb = avctx->pb;
277 av_dict_set(&avctx->metadata, "guid", guidstr, 0);
288 vst = avformat_new_stream(avctx, NULL);
296 avpriv_request_sample(avctx, "compression");
316 avpriv_request_sample(avctx, "unknown video class");
321 ast = avformat_new_stream(avctx, NULL);
328 avpriv_request_sample(avctx, "compression");
330 avpriv_request_sample(avctx, "unknown audio class");
347 mlv->pb[100] = avctx->pb;
348 ret = scan_file(avctx, vst, ast, 100);
353 if (strlen(avctx->url) > 2) {
355 char *filename = av_strdup(avctx->url);
362 if (avctx->io_open(avctx, &mlv->pb[i], filename, AVIO_FLAG_READ, NULL) < 0)
365 av_log(avctx, AV_LOG_WARNING, "ignoring %s; bad format or guid mismatch\n", filename);
366 ff_format_io_close(avctx, &mlv->pb[i]);
369 av_log(avctx, AV_LOG_INFO, "scanning %s\n", filename);
370 ret = scan_file(avctx, vst, ast, i);
372 av_log(avctx, AV_LOG_WARNING, "ignoring %s; %s\n", filename, av_err2str(ret));
373 ff_format_io_close(avctx, &mlv->pb[i]);
386 av_log(avctx, AV_LOG_ERROR, "no index entries found\n");
400 static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
402 MlvContext *mlv = avctx->priv_data;
409 if (!avctx->nb_streams)
412 st = avctx->streams[mlv->stream_index];
419 av_log(avctx, AV_LOG_ERROR, "could not find index entry for frame %"PRId64"\n", mlv->pts);
459 if (mlv->stream_index == avctx->nb_streams) {
466 static int read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
468 MlvContext *mlv = avctx->priv_data;
473 if (!(avctx->pb->seekable & AVIO_SEEKABLE_NORMAL))