mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-01 15:56:59 +00:00
Modifications for the removal of the varargs based mxinfo() functions.
This commit is contained in:
parent
4f973c4420
commit
93b72de1fb
@ -27,7 +27,7 @@ using namespace std;
|
||||
|
||||
void
|
||||
set_usage() {
|
||||
usage_text = _(
|
||||
usage_text = Y(
|
||||
"base64util <encode|decode> <input> <output> [maxlen]\n"
|
||||
"\n"
|
||||
" encode - Read from <input>, encode to Base64 and write to <output>.\n"
|
||||
@ -64,12 +64,12 @@ main(int argc,
|
||||
else if (!strcmp(argv[1], "decode"))
|
||||
mode = 'd';
|
||||
else
|
||||
mxerror(_("Invalid mode '%s'.\n"), argv[1]);
|
||||
mxerror(boost::format(Y("Invalid mode '%1%'.\n")) % argv[1]);
|
||||
|
||||
maxlen = 72;
|
||||
if ((argc == 5) && (mode == 'e')) {
|
||||
if (!parse_int(argv[4], maxlen) || (maxlen < 4))
|
||||
mxerror(_("Max line length must be >= 4.\n\n"));
|
||||
mxerror(Y("Max line length must be >= 4.\n\n"));
|
||||
} else if ((argc > 5) || ((argc > 4) && (mode == 'd')))
|
||||
usage(2);
|
||||
|
||||
@ -80,15 +80,13 @@ main(int argc,
|
||||
if (mode != 'e')
|
||||
intext = new mm_text_io_c(in);
|
||||
} catch(...) {
|
||||
mxerror(_("The file '%s' could not be opened for reading (%d, %s).\n"),
|
||||
argv[2], errno, strerror(errno));
|
||||
mxerror(boost::format(Y("The file '%1%' could not be opened for reading (%2%, %3%).\n")) % argv[2] % errno % strerror(errno));
|
||||
}
|
||||
|
||||
try {
|
||||
out = new mm_file_io_c(argv[3], MODE_CREATE);
|
||||
} catch(...) {
|
||||
mxerror(_("The file '%s' could not be opened for writing (%d, %s).\n"),
|
||||
argv[3], errno, strerror(errno));
|
||||
mxerror(boost::format(Y("The file '%1%' could not be opened for writing (%2%, %3%).\n")) % argv[3] % errno % strerror(errno));
|
||||
}
|
||||
|
||||
in->save_pos();
|
||||
@ -121,7 +119,7 @@ main(int argc,
|
||||
} catch(...) {
|
||||
delete in;
|
||||
delete out;
|
||||
mxerror(_("The Base64 encoded data could not be decoded.\n"));
|
||||
mxerror(Y("The Base64 encoded data could not be decoded.\n"));
|
||||
}
|
||||
out->write(buffer, size);
|
||||
|
||||
@ -129,7 +127,7 @@ main(int argc,
|
||||
delete out;
|
||||
}
|
||||
|
||||
mxinfo(_("Done.\n"));
|
||||
mxinfo(Y("Done.\n"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -35,31 +35,31 @@ protected:
|
||||
void
|
||||
dirac_info_c::handle_auxiliary_data_unit(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Auxiliary data at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Auxiliary data at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
void
|
||||
dirac_info_c::handle_end_of_sequence_unit(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("End of sequence at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("End of sequence at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
void
|
||||
dirac_info_c::handle_padding_unit(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Padding at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Padding at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
void
|
||||
dirac_info_c::handle_picture_unit(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Picture at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Picture at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
void
|
||||
dirac_info_c::handle_sequence_header_unit(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Sequence header at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Sequence header at %1% size %2%%3%\n" )) %m_stream_pos % packet->get_size() % checksum);
|
||||
|
||||
m_seqhdr_found = dirac::parse_sequence_header(packet->get(), packet->get_size(), m_seqhdr);
|
||||
|
||||
@ -67,14 +67,14 @@ dirac_info_c::handle_sequence_header_unit(memory_cptr packet) {
|
||||
if (m_seqhdr_found)
|
||||
dump_sequence_header(m_seqhdr);
|
||||
else
|
||||
mxinfo(" parsing failed\n");
|
||||
mxinfo(Y(" parsing failed\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
dirac_info_c::handle_unknown_unit(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Unknown (0x%02x) at " LLD " size %d%s\n", packet->get()[4], m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Unknown (0x%|1$02x|) at %2% size %3%%4%\n")) % (int)packet->get()[4] % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
string
|
||||
@ -82,63 +82,63 @@ dirac_info_c::create_checksum_info(memory_cptr packet) {
|
||||
if (!g_opt_checksum)
|
||||
return "";
|
||||
|
||||
return mxsprintf(" checksum 0x%08x", calc_adler32(packet->get(), packet->get_size()));
|
||||
return (boost::format(Y(" checksum 0x%|1$08x|")) % calc_adler32(packet->get(), packet->get_size())).str();
|
||||
}
|
||||
|
||||
void
|
||||
dirac_info_c::dump_sequence_header(dirac::sequence_header_t &seqhdr) {
|
||||
mxinfo(" Sequence header dump:\n"
|
||||
" major_version: %u\n"
|
||||
" minor_version: %u\n"
|
||||
" profile: %u\n"
|
||||
" level: %u\n"
|
||||
" base_video_format: %u\n"
|
||||
" pixel_width: %u\n"
|
||||
" pixel_height: %u\n"
|
||||
" chroma_format: %u\n"
|
||||
" interlaced: %u\n"
|
||||
" top_field_first: %u\n"
|
||||
" frame_rate_numerator: %u\n"
|
||||
" frame_rate_denominator: %u\n"
|
||||
" aspect_ratio_numerator: %u\n"
|
||||
" aspect_ratio_denominator: %u\n"
|
||||
" clean_width: %u\n"
|
||||
" clean_height: %u\n"
|
||||
" left_offset: %u\n"
|
||||
" top_offset: %u\n",
|
||||
seqhdr.major_version,
|
||||
seqhdr.minor_version,
|
||||
seqhdr.profile,
|
||||
seqhdr.level,
|
||||
seqhdr.base_video_format,
|
||||
seqhdr.pixel_width,
|
||||
seqhdr.pixel_height,
|
||||
seqhdr.chroma_format,
|
||||
seqhdr.interlaced,
|
||||
seqhdr.top_field_first,
|
||||
seqhdr.frame_rate_numerator,
|
||||
seqhdr.frame_rate_denominator,
|
||||
seqhdr.aspect_ratio_numerator,
|
||||
seqhdr.aspect_ratio_denominator,
|
||||
seqhdr.clean_width,
|
||||
seqhdr.clean_height,
|
||||
seqhdr.left_offset,
|
||||
seqhdr.top_offset);
|
||||
mxinfo(boost::format(Y(" Sequence header dump:\n"
|
||||
" major_version: %1%\n"
|
||||
" minor_version: %2%\n"
|
||||
" profile: %3%\n"
|
||||
" level: %4%\n"
|
||||
" base_video_format: %5%\n"
|
||||
" pixel_width: %6%\n"
|
||||
" pixel_height: %7%\n"
|
||||
" chroma_format: %8%\n"
|
||||
" interlaced: %9%\n"
|
||||
" top_field_first: %10%\n"
|
||||
" frame_rate_numerator: %11%\n"
|
||||
" frame_rate_denominator: %12%\n"
|
||||
" aspect_ratio_numerator: %13%\n"
|
||||
" aspect_ratio_denominator: %14%\n"
|
||||
" clean_width: %15%\n"
|
||||
" clean_height: %16%\n"
|
||||
" left_offset: %17%\n"
|
||||
" top_offset: %18%\n"))
|
||||
% seqhdr.major_version
|
||||
% seqhdr.minor_version
|
||||
% seqhdr.profile
|
||||
% seqhdr.level
|
||||
% seqhdr.base_video_format
|
||||
% seqhdr.pixel_width
|
||||
% seqhdr.pixel_height
|
||||
% seqhdr.chroma_format
|
||||
% seqhdr.interlaced
|
||||
% seqhdr.top_field_first
|
||||
% seqhdr.frame_rate_numerator
|
||||
% seqhdr.frame_rate_denominator
|
||||
% seqhdr.aspect_ratio_numerator
|
||||
% seqhdr.aspect_ratio_denominator
|
||||
% seqhdr.clean_width
|
||||
% seqhdr.clean_height
|
||||
% seqhdr.left_offset
|
||||
% seqhdr.top_offset);
|
||||
}
|
||||
|
||||
static void
|
||||
show_help() {
|
||||
mxinfo("diracparser [options] input_file_name\n"
|
||||
"\n"
|
||||
"Options for output and information control:\n"
|
||||
"\n"
|
||||
" -c, --checksum Calculate and output checksums of each unit\n"
|
||||
" -s, --sequence-headers Show the content of sequence headers\n"
|
||||
"\n"
|
||||
"General options:\n"
|
||||
"\n"
|
||||
" -h, --help This help text\n"
|
||||
" -V, --version Print version information\n");
|
||||
mxinfo(Y("diracparser [options] input_file_name\n"
|
||||
"\n"
|
||||
"Options for output and information control:\n"
|
||||
"\n"
|
||||
" -c, --checksum Calculate and output checksums of each unit\n"
|
||||
" -s, --sequence-headers Show the content of sequence headers\n"
|
||||
"\n"
|
||||
"General options:\n"
|
||||
"\n"
|
||||
" -h, --help This help text\n"
|
||||
" -V, --version Print version information\n"));
|
||||
mxexit(0);
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ parse_args(vector<string> &args) {
|
||||
g_opt_sequence_headers = true;
|
||||
|
||||
else if (!file_name.empty())
|
||||
mxerror("More than one input file given\n");
|
||||
mxerror(Y("More than one input file given\n"));
|
||||
|
||||
else
|
||||
file_name = *arg;
|
||||
@ -192,7 +192,7 @@ parse_args(vector<string> &args) {
|
||||
}
|
||||
|
||||
if (file_name.empty())
|
||||
mxerror("No file name given\n");
|
||||
mxerror(Y("No file name given\n"));
|
||||
|
||||
return file_name;
|
||||
}
|
||||
@ -205,7 +205,7 @@ parse_file(const string &file_name) {
|
||||
int64_t size = in.get_size();
|
||||
|
||||
if (4 > size)
|
||||
mxerror("File too small\n");
|
||||
mxerror(Y("File too small\n"));
|
||||
|
||||
memory_cptr mem = memory_c::alloc(buf_size);
|
||||
unsigned char *ptr = mem->get();
|
||||
@ -234,7 +234,7 @@ main(int argc,
|
||||
try {
|
||||
parse_file(file_name);
|
||||
} catch (...) {
|
||||
mxerror("File not found\n");
|
||||
mxerror(Y("File not found\n"));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -40,19 +40,19 @@ protected:
|
||||
void
|
||||
vc1_info_c::handle_end_of_sequence_packet(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("End of sequence at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("End of sequence at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
void
|
||||
vc1_info_c::handle_entrypoint_packet(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Entrypoint at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Entrypoint at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
|
||||
if (!g_opt_entrypoints)
|
||||
return;
|
||||
|
||||
if (!m_seqhdr_found) {
|
||||
mxinfo(" No sequence header found yet; parsing not possible\n");
|
||||
mxinfo(Y(" No sequence header found yet; parsing not possible\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -64,19 +64,19 @@ vc1_info_c::handle_entrypoint_packet(memory_cptr packet) {
|
||||
void
|
||||
vc1_info_c::handle_field_packet(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Field at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Field at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
void
|
||||
vc1_info_c::handle_frame_packet(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Frame at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Frame at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
|
||||
if (!g_opt_frames)
|
||||
return;
|
||||
|
||||
if (!m_seqhdr_found) {
|
||||
mxinfo(" No sequence header found yet; parsing not possible\n");
|
||||
mxinfo(Y(" No sequence header found yet; parsing not possible\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ vc1_info_c::handle_frame_packet(memory_cptr packet) {
|
||||
void
|
||||
vc1_info_c::handle_sequence_header_packet(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Sequence header at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Sequence header at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
|
||||
m_seqhdr_found = vc1::parse_sequence_header(packet->get(), packet->get_size(), m_seqhdr);
|
||||
|
||||
@ -96,21 +96,21 @@ vc1_info_c::handle_sequence_header_packet(memory_cptr packet) {
|
||||
if (m_seqhdr_found)
|
||||
dump_sequence_header(m_seqhdr);
|
||||
else
|
||||
mxinfo(" parsing failed\n");
|
||||
mxinfo(Y(" parsing failed\n"));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
vc1_info_c::handle_slice_packet(memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Slice at " LLD " size %d%s\n", m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Slice at %1% size %2%%3%\n")) % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
void
|
||||
vc1_info_c::handle_unknown_packet(uint32_t marker,
|
||||
memory_cptr packet) {
|
||||
string checksum = create_checksum_info(packet);
|
||||
mxinfo("Unknown (0x%08x) at " LLD " size %d%s\n", marker, m_stream_pos, packet->get_size(), checksum.c_str());
|
||||
mxinfo(boost::format(Y("Unknown (0x%|1$08x|) at %2% size %3%%4%\n")) % marker % m_stream_pos % packet->get_size() % checksum);
|
||||
}
|
||||
|
||||
string
|
||||
@ -118,148 +118,148 @@ vc1_info_c::create_checksum_info(memory_cptr packet) {
|
||||
if (!g_opt_checksum)
|
||||
return "";
|
||||
|
||||
return mxsprintf(" checksum 0x%08x", calc_adler32(packet->get(), packet->get_size()));
|
||||
return (boost::format(Y(" checksum 0x%|1$08x|")) % calc_adler32(packet->get(), packet->get_size())).str();
|
||||
}
|
||||
|
||||
void
|
||||
vc1_info_c::dump_sequence_header(vc1::sequence_header_t &seqhdr) {
|
||||
static const char *profile_names[4] = { "Simple", "Main", "Complex", "Advanced" };
|
||||
|
||||
mxinfo(" Sequence header dump:\n"
|
||||
" profile: %d (%s)\n"
|
||||
" level: %d\n"
|
||||
" chroma_format: %d\n"
|
||||
" frame_rtq_postproc: %d\n"
|
||||
" bit_rtq_postproc: %d\n"
|
||||
" postproc_flag: %d\n"
|
||||
" pixel_width: %d\n"
|
||||
" pixel_height: %d\n"
|
||||
" pulldown_flag: %d\n"
|
||||
" interlace_flag: %d\n"
|
||||
" tf_counter_flag: %d\n"
|
||||
" f_inter_p_flag: %d\n"
|
||||
" psf_mode_flag: %d\n"
|
||||
" display_info_flag: %d\n"
|
||||
" display_width: %d\n"
|
||||
" display_height: %d\n"
|
||||
" aspect_ratio_flag: %d\n"
|
||||
" aspect_ratio_width: %d\n"
|
||||
" aspect_ratio_height: %d\n"
|
||||
" framerate_flag: %d\n"
|
||||
" framerate_num: %d\n"
|
||||
" framerate_den: %d\n"
|
||||
" hrd_param_flag: %d\n"
|
||||
" hrd_num_leaky_buckets: %d\n",
|
||||
seqhdr.profile, profile_names[seqhdr.profile],
|
||||
seqhdr.level,
|
||||
seqhdr.chroma_format,
|
||||
seqhdr.frame_rtq_postproc,
|
||||
seqhdr.bit_rtq_postproc,
|
||||
seqhdr.postproc_flag,
|
||||
seqhdr.pixel_width,
|
||||
seqhdr.pixel_height,
|
||||
seqhdr.pulldown_flag,
|
||||
seqhdr.interlace_flag,
|
||||
seqhdr.tf_counter_flag,
|
||||
seqhdr.f_inter_p_flag,
|
||||
seqhdr.psf_mode_flag,
|
||||
seqhdr.display_info_flag,
|
||||
seqhdr.display_width,
|
||||
seqhdr.display_height,
|
||||
seqhdr.aspect_ratio_flag,
|
||||
seqhdr.aspect_ratio_width,
|
||||
seqhdr.aspect_ratio_height,
|
||||
seqhdr.framerate_flag,
|
||||
seqhdr.framerate_num,
|
||||
seqhdr.framerate_den,
|
||||
seqhdr.hrd_param_flag,
|
||||
seqhdr.hrd_num_leaky_buckets);
|
||||
mxinfo(boost::format(Y(" Sequence header dump:\n"
|
||||
" profile: %1% (%2%)\n"
|
||||
" level: %3%\n"
|
||||
" chroma_format: %4%\n"
|
||||
" frame_rtq_postproc: %5%\n"
|
||||
" bit_rtq_postproc: %6%\n"
|
||||
" postproc_flag: %7%\n"
|
||||
" pixel_width: %8%\n"
|
||||
" pixel_height: %9%\n"
|
||||
" pulldown_flag: %10%\n"
|
||||
" interlace_flag: %11%\n"
|
||||
" tf_counter_flag: %12%\n"
|
||||
" f_inter_p_flag: %13%\n"
|
||||
" psf_mode_flag: %14%\n"
|
||||
" display_info_flag: %15%\n"
|
||||
" display_width: %16%\n"
|
||||
" display_height: %17%\n"
|
||||
" aspect_ratio_flag: %18%\n"
|
||||
" aspect_ratio_width: %19%\n"
|
||||
" aspect_ratio_height: %20%\n"
|
||||
" framerate_flag: %21%\n"
|
||||
" framerate_num: %22%\n"
|
||||
" framerate_den: %23%\n"
|
||||
" hrd_param_flag: %24%\n"
|
||||
" hrd_num_leaky_buckets: %25%\n"))
|
||||
% seqhdr.profile % profile_names[seqhdr.profile]
|
||||
% seqhdr.level
|
||||
% seqhdr.chroma_format
|
||||
% seqhdr.frame_rtq_postproc
|
||||
% seqhdr.bit_rtq_postproc
|
||||
% seqhdr.postproc_flag
|
||||
% seqhdr.pixel_width
|
||||
% seqhdr.pixel_height
|
||||
% seqhdr.pulldown_flag
|
||||
% seqhdr.interlace_flag
|
||||
% seqhdr.tf_counter_flag
|
||||
% seqhdr.f_inter_p_flag
|
||||
% seqhdr.psf_mode_flag
|
||||
% seqhdr.display_info_flag
|
||||
% seqhdr.display_width
|
||||
% seqhdr.display_height
|
||||
% seqhdr.aspect_ratio_flag
|
||||
% seqhdr.aspect_ratio_width
|
||||
% seqhdr.aspect_ratio_height
|
||||
% seqhdr.framerate_flag
|
||||
% seqhdr.framerate_num
|
||||
% seqhdr.framerate_den
|
||||
% seqhdr.hrd_param_flag
|
||||
% seqhdr.hrd_num_leaky_buckets);
|
||||
}
|
||||
|
||||
void
|
||||
vc1_info_c::dump_entrypoint(vc1::entrypoint_t &entrypoint) {
|
||||
mxinfo(" Entrypoint dump:\n"
|
||||
" broken_link_flag: %d\n"
|
||||
" closed_entry_flag: %d\n"
|
||||
" pan_scan_flag: %d\n"
|
||||
" refdist_flag: %d\n"
|
||||
" loop_filter_flag: %d\n"
|
||||
" fast_uvmc_flag: %d\n"
|
||||
" extended_mv_flag: %d\n"
|
||||
" dquant: %d\n"
|
||||
" vs_transform_flag: %d\n"
|
||||
" overlap_flag: %d\n"
|
||||
" quantizer_mode: %d\n"
|
||||
" coded_dimensions_flag: %d\n"
|
||||
" coded_width: %d\n"
|
||||
" coded_height: %d\n"
|
||||
" extended_dmv_flag: %d\n"
|
||||
" luma_scaling_flag: %d\n"
|
||||
" luma_scaling: %d\n"
|
||||
" chroma_scaling_flag: %d\n"
|
||||
" chroma_scaling: %d\n",
|
||||
entrypoint.broken_link_flag,
|
||||
entrypoint.closed_entry_flag,
|
||||
entrypoint.pan_scan_flag,
|
||||
entrypoint.refdist_flag,
|
||||
entrypoint.loop_filter_flag,
|
||||
entrypoint.fast_uvmc_flag,
|
||||
entrypoint.extended_mv_flag,
|
||||
entrypoint.dquant,
|
||||
entrypoint.vs_transform_flag,
|
||||
entrypoint.overlap_flag,
|
||||
entrypoint.quantizer_mode,
|
||||
entrypoint.coded_dimensions_flag,
|
||||
entrypoint.coded_width,
|
||||
entrypoint.coded_height,
|
||||
entrypoint.extended_dmv_flag,
|
||||
entrypoint.luma_scaling_flag,
|
||||
entrypoint.luma_scaling,
|
||||
entrypoint.chroma_scaling_flag,
|
||||
entrypoint.chroma_scaling);
|
||||
mxinfo(boost::format(Y(" Entrypoint dump:\n"
|
||||
" broken_link_flag: %1%\n"
|
||||
" closed_entry_flag: %2%\n"
|
||||
" pan_scan_flag: %3%\n"
|
||||
" refdist_flag: %4%\n"
|
||||
" loop_filter_flag: %5%\n"
|
||||
" fast_uvmc_flag: %6%\n"
|
||||
" extended_mv_flag: %7%\n"
|
||||
" dquant: %8%\n"
|
||||
" vs_transform_flag: %9%\n"
|
||||
" overlap_flag: %10%\n"
|
||||
" quantizer_mode: %11%\n"
|
||||
" coded_dimensions_flag: %12%\n"
|
||||
" coded_width: %13%\n"
|
||||
" coded_height: %14%\n"
|
||||
" extended_dmv_flag: %15%\n"
|
||||
" luma_scaling_flag: %16%\n"
|
||||
" luma_scaling: %17%\n"
|
||||
" chroma_scaling_flag: %18%\n"
|
||||
" chroma_scaling: %19%\n"))
|
||||
% entrypoint.broken_link_flag
|
||||
% entrypoint.closed_entry_flag
|
||||
% entrypoint.pan_scan_flag
|
||||
% entrypoint.refdist_flag
|
||||
% entrypoint.loop_filter_flag
|
||||
% entrypoint.fast_uvmc_flag
|
||||
% entrypoint.extended_mv_flag
|
||||
% entrypoint.dquant
|
||||
% entrypoint.vs_transform_flag
|
||||
% entrypoint.overlap_flag
|
||||
% entrypoint.quantizer_mode
|
||||
% entrypoint.coded_dimensions_flag
|
||||
% entrypoint.coded_width
|
||||
% entrypoint.coded_height
|
||||
% entrypoint.extended_dmv_flag
|
||||
% entrypoint.luma_scaling_flag
|
||||
% entrypoint.luma_scaling
|
||||
% entrypoint.chroma_scaling_flag
|
||||
% entrypoint.chroma_scaling);
|
||||
}
|
||||
|
||||
void
|
||||
vc1_info_c::dump_frame_header(vc1::frame_header_t &frame_header) {
|
||||
mxinfo(" Frame header dump:\n"
|
||||
" fcm: %d (%s)\n"
|
||||
" frame_type: %s\n"
|
||||
" tf_counter: %d\n"
|
||||
" repeat_frame: %d\n"
|
||||
" top_field_first_flag: %d\n"
|
||||
" repeat_first_field_flag: %d\n",
|
||||
frame_header.fcm,
|
||||
frame_header.fcm == 0x00 ? "progressive"
|
||||
: frame_header.fcm == 0x10 ? "frame-interlace"
|
||||
: frame_header.fcm == 0x11 ? "field-interlace"
|
||||
: "unknown",
|
||||
frame_header.frame_type == vc1::FRAME_TYPE_I ? "I"
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_P ? "P"
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_B ? "B"
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_BI ? "BI"
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_P_SKIPPED ? "P (skipped)"
|
||||
: "unknown",
|
||||
frame_header.tf_counter,
|
||||
frame_header.repeat_frame,
|
||||
frame_header.top_field_first_flag,
|
||||
frame_header.repeat_first_field_flag);
|
||||
mxinfo(boost::format(Y(" Frame header dump:\n"
|
||||
" fcm: %1% (%2%)\n"
|
||||
" frame_type: %3%\n"
|
||||
" tf_counter: %4%\n"
|
||||
" repeat_frame: %5%\n"
|
||||
" top_field_first_flag: %6%\n"
|
||||
" repeat_first_field_flag: %7%\n"))
|
||||
% frame_header.fcm
|
||||
% ( frame_header.fcm == 0x00 ? Y("progressive")
|
||||
: frame_header.fcm == 0x10 ? Y("frame-interlace")
|
||||
: frame_header.fcm == 0x11 ? Y("field-interlace")
|
||||
: Y("unknown"))
|
||||
% ( frame_header.frame_type == vc1::FRAME_TYPE_I ? Y("I")
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_P ? Y("P")
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_B ? Y("B")
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_BI ? Y("BI")
|
||||
: frame_header.frame_type == vc1::FRAME_TYPE_P_SKIPPED ? Y("P (skipped)")
|
||||
: Y("unknown"))
|
||||
% frame_header.tf_counter
|
||||
% frame_header.repeat_frame
|
||||
% frame_header.top_field_first_flag
|
||||
% frame_header.repeat_first_field_flag);
|
||||
}
|
||||
|
||||
static void
|
||||
show_help() {
|
||||
mxinfo("vc1parser [options] input_file_name\n"
|
||||
"\n"
|
||||
"Options for output and information control:\n"
|
||||
"\n"
|
||||
" -c, --checksum Calculate and output checksums of each unit\n"
|
||||
" -e, --entrypoints Show the content of entry point headers\n"
|
||||
" -f, --frames Show basic frame header content\n"
|
||||
" -s, --sequence-headers Show the content of sequence headers\n"
|
||||
"\n"
|
||||
"General options:\n"
|
||||
"\n"
|
||||
" -h, --help This help text\n"
|
||||
" -V, --version Print version information\n");
|
||||
mxinfo(Y("vc1parser [options] input_file_name\n"
|
||||
"\n"
|
||||
"Options for output and information control:\n"
|
||||
"\n"
|
||||
" -c, --checksum Calculate and output checksums of each unit\n"
|
||||
" -e, --entrypoints Show the content of entry point headers\n"
|
||||
" -f, --frames Show basic frame header content\n"
|
||||
" -s, --sequence-headers Show the content of sequence headers\n"
|
||||
"\n"
|
||||
"General options:\n"
|
||||
"\n"
|
||||
" -h, --help This help text\n"
|
||||
" -V, --version Print version information\n"));
|
||||
mxexit(0);
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ parse_args(vector<string> &args) {
|
||||
g_opt_sequence_headers = true;
|
||||
|
||||
else if (!file_name.empty())
|
||||
mxerror("More than one input file given\n");
|
||||
mxerror(Y("More than one input file given\n"));
|
||||
|
||||
else
|
||||
file_name = *arg;
|
||||
@ -319,7 +319,7 @@ parse_args(vector<string> &args) {
|
||||
}
|
||||
|
||||
if (file_name.empty())
|
||||
mxerror("No file name given\n");
|
||||
mxerror(Y("No file name given\n"));
|
||||
|
||||
return file_name;
|
||||
}
|
||||
@ -332,7 +332,7 @@ parse_file(const string &file_name) {
|
||||
int64_t size = in.get_size();
|
||||
|
||||
if (4 > size)
|
||||
mxerror("File too small\n");
|
||||
mxerror(Y("File too small\n"));
|
||||
|
||||
memory_cptr mem = memory_c::alloc(buf_size);
|
||||
unsigned char *ptr = mem->get();
|
||||
@ -361,7 +361,7 @@ main(int argc,
|
||||
try {
|
||||
parse_file(file_name);
|
||||
} catch (...) {
|
||||
mxerror("File not found\n");
|
||||
mxerror(Y("File not found\n"));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user