本文整理汇总了C++中ExportContext::writeAttr方法的典型用法代码示例。如果您正苦于以下问题:C++ ExportContext::writeAttr方法的具体用法?C++ ExportContext::writeAttr怎么用?C++ ExportContext::writeAttr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExportContext
的用法示例。
在下文中一共展示了ExportContext::writeAttr方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: export_multistream_avi_info_attr
void export_multistream_avi_info_attr(
media_multistream_format::avi_info f,
ExportContext& context) {
context.writeAttr(gKey_us_per_frame, f.us_per_frame);
context.writeAttr(gKey_width, (uint32)f.width);
context.writeAttr(gKey_height, (uint32)f.height);
}
示例2: export_multistream_flags_attr
void export_multistream_flags_attr(
uint32 flags,
ExportContext& context) {
if(flags & media_multistream_format::B_HEADER_HAS_FLAGS)
context.writeAttr(gKey_header_has_flags, (int32)1);
if(flags & media_multistream_format::B_CLEAN_BUFFERS)
context.writeAttr(gKey_clean_buffers, (int32)1);
if(flags & media_multistream_format::B_HOMOGENOUS_BUFFERS)
context.writeAttr(gKey_homogenous_buffers, (int32)1);
}
示例3: export_raw_video_attr
void export_raw_video_attr(
const media_raw_video_format& f,
ExportContext& context) {
media_raw_video_format& w = media_raw_video_format::wildcard;
// attributes
if(f.field_rate != w.field_rate)
context.writeAttr(gKey_field_rate, f.field_rate);
if(f.interlace != w.interlace)
context.writeAttr(gKey_interlace, f.interlace);
if(f.first_active != w.first_active)
context.writeAttr(gKey_first_active, f.first_active);
if(f.last_active != w.last_active)
context.writeAttr(gKey_last_active, f.last_active);
if(f.pixel_width_aspect != w.pixel_width_aspect)
context.writeAttr(gKey_pixel_width_aspect, (uint32)f.pixel_width_aspect);
if(f.pixel_height_aspect != w.pixel_height_aspect)
context.writeAttr(gKey_pixel_height_aspect, (uint32)f.pixel_height_aspect);
switch(f.orientation) {
case B_VIDEO_TOP_LEFT_RIGHT:
context.writeAttr(gKey_orientation, "B_VIDEO_TOP_LEFT_RIGHT");
break;
case B_VIDEO_BOTTOM_LEFT_RIGHT:
context.writeAttr(gKey_orientation, "B_VIDEO_BOTTOM_LEFT_RIGHT");
break;
default:
break;
}
}
示例4: export_multi_audio_info_attr
void export_multi_audio_info_attr(
const media_multi_audio_info& f,
ExportContext& context) {
media_multi_audio_format& w = media_multi_audio_format::wildcard;
if(f.channel_mask != w.channel_mask)
context.writeAttr(gKey_channel_mask, f.channel_mask);
if(f.valid_bits != w.valid_bits)
context.writeAttr(gKey_valid_bits, f.valid_bits);
if(f.matrix_mask != w.matrix_mask)
context.writeAttr(gKey_matrix_mask, f.matrix_mask);
}
示例5: export_encoded_audio_attr
void export_encoded_audio_attr(
const media_encoded_audio_format& f,
ExportContext& context) {
media_encoded_audio_format& w = media_encoded_audio_format::wildcard;
switch(f.encoding) {
case media_encoded_audio_format::B_ANY:
context.writeAttr(gKey_encoding, "B_ANY");
break;
default:
break;
}
if(f.bit_rate != w.bit_rate)
context.writeAttr(gKey_bit_rate, f.bit_rate);
if(f.frame_size != w.frame_size)
context.writeAttr(gKey_frame_size, f.frame_size);
}
示例6: export_video_display_info_attr
void export_video_display_info_attr(
const media_video_display_info& d,
ExportContext& context) {
media_video_display_info& w = media_video_display_info::wildcard;
if(d.line_width != w.line_width)
context.writeAttr(gKey_line_width, d.line_width);
if(d.line_count != w.line_count)
context.writeAttr(gKey_line_count, d.line_count);
if(d.bytes_per_row != w.bytes_per_row)
context.writeAttr(gKey_bytes_per_row, d.bytes_per_row);
if(d.pixel_offset != w.pixel_offset)
context.writeAttr(gKey_pixel_offset, d.pixel_offset);
if(d.line_offset != w.line_offset)
context.writeAttr(gKey_line_offset, d.line_offset);
if(d.format != w.format)
write_colorspace_attr(gKey_format, d.format, context);
}
示例7: export_encoded_video_attr
void export_encoded_video_attr(
const media_encoded_video_format& f,
ExportContext& context) {
media_encoded_video_format& w = media_encoded_video_format::wildcard;
switch(f.encoding) {
case media_encoded_video_format::B_ANY:
context.writeAttr(gKey_encoding, "B_ANY");
break;
default:
break;
}
if(f.avg_bit_rate != w.avg_bit_rate)
context.writeAttr(gKey_avg_bit_rate, f.avg_bit_rate);
if(f.max_bit_rate != w.max_bit_rate)
context.writeAttr(gKey_max_bit_rate, f.max_bit_rate);
if(f.frame_size != w.frame_size)
context.writeAttr(gKey_frame_size, f.frame_size);
if(f.forward_history != w.forward_history)
context.writeAttr(gKey_forward_history, (int32)f.forward_history);
if(f.backward_history != w.backward_history)
context.writeAttr(gKey_backward_history, (int32)f.backward_history);
}
示例8: export_raw_audio_attr
void export_raw_audio_attr(
const media_raw_audio_format& f,
ExportContext& context) {
media_raw_audio_format& w = media_raw_audio_format::wildcard;
if(f.frame_rate != w.frame_rate)
context.writeAttr(gKey_frame_rate, f.frame_rate);
if(f.channel_count != w.channel_count)
context.writeAttr(gKey_channel_count, f.channel_count);
if(f.buffer_size != w.buffer_size)
context.writeAttr(gKey_buffer_size, f.buffer_size);
switch(f.format) {
case media_raw_audio_format::B_AUDIO_UCHAR:
context.writeAttr(gKey_format, "B_AUDIO_UCHAR");
break;
case media_raw_audio_format::B_AUDIO_SHORT:
context.writeAttr(gKey_format, "B_AUDIO_SHORT");
break;
case media_raw_audio_format::B_AUDIO_FLOAT:
context.writeAttr(gKey_format, "B_AUDIO_FLOAT");
break;
case media_raw_audio_format::B_AUDIO_INT:
context.writeAttr(gKey_format, "B_AUDIO_INT");
break;
default:
break;
}
switch(f.byte_order) {
case B_MEDIA_BIG_ENDIAN:
context.writeAttr(gKey_byte_order, "B_MEDIA_BIG_ENDIAN");
break;
case B_MEDIA_LITTLE_ENDIAN:
context.writeAttr(gKey_byte_order, "B_MEDIA_LITTLE_ENDIAN");
break;
default:
break;
}
}
示例9: export_multistream_attr
void export_multistream_attr(
const media_multistream_format& f,
ExportContext& context) {
media_multistream_format& w = media_multistream_format::wildcard;
// attributes
switch(f.format) {
case media_multistream_format::B_ANY:
context.writeAttr(gKey_multistream_format, "B_ANY");
break;
case media_multistream_format::B_VID:
context.writeAttr(gKey_multistream_format, "B_VID");
break;
case media_multistream_format::B_AVI:
context.writeAttr(gKey_multistream_format, "B_AVI");
break;
case media_multistream_format::B_MPEG1:
context.writeAttr(gKey_multistream_format, "B_MPEG1");
break;
case media_multistream_format::B_MPEG2:
context.writeAttr(gKey_multistream_format, "B_MPEG2");
break;
case media_multistream_format::B_QUICKTIME:
context.writeAttr(gKey_multistream_format, "B_QUICKTIME");
break;
default:
if(f.format != w.format) {
// write numeric value
context.writeAttr(gKey_multistream_format, f.format);
}
break;
}
if(f.avg_bit_rate != w.avg_bit_rate)
context.writeAttr(gKey_avg_bit_rate, f.avg_bit_rate);
if(f.max_bit_rate != w.max_bit_rate)
context.writeAttr(gKey_max_bit_rate, f.max_bit_rate);
if(f.avg_chunk_size != w.avg_chunk_size)
context.writeAttr(gKey_avg_chunk_size, f.avg_chunk_size);
if(f.max_chunk_size != w.max_chunk_size)
context.writeAttr(gKey_max_chunk_size, f.max_chunk_size);
}
示例10: export_multistream_vid_info_attr
void export_multistream_vid_info_attr(
media_multistream_format::vid_info f,
ExportContext& context) {
// +++++ no wildcard to compare against (assume 0 == wildcard?)
context.writeAttr(gKey_frame_rate, f.frame_rate);
context.writeAttr(gKey_width, (uint32)f.width);
context.writeAttr(gKey_height, (uint32)f.height);
write_colorspace_attr(gKey_space, f.space, context);
context.writeAttr(gKey_sampling_rate, f.sampling_rate);
switch(f.sample_format) {
case B_UNDEFINED_SAMPLES:
context.writeAttr(gKey_sample_format, "B_UNDEFINED_SAMPLES");
break;
case B_LINEAR_SAMPLES:
context.writeAttr(gKey_sample_format, "B_LINEAR_SAMPLES");
break;
case B_FLOAT_SAMPLES:
context.writeAttr(gKey_sample_format, "B_FLOAT_SAMPLES");
break;
case B_MULAW_SAMPLES:
context.writeAttr(gKey_sample_format, "B_MULAW_SAMPLES");
break;
default:
break;
}
switch(f.byte_order) {
case B_MEDIA_BIG_ENDIAN:
context.writeAttr(gKey_byte_order, "B_MEDIA_BIG_ENDIAN");
break;
case B_MEDIA_LITTLE_ENDIAN:
context.writeAttr(gKey_byte_order, "B_MEDIA_LITTLE_ENDIAN");
break;
default:
break;
}
context.writeAttr(gKey_channel_count, (uint32)f.channel_count);
}
示例11: write_colorspace_attr
void write_colorspace_attr(
const char* key,
color_space c,
ExportContext& context) {
switch(c) {
case B_RGB32:
context.writeAttr(key, "B_RGB32");
break;
case B_RGBA32:
context.writeAttr(key, "B_RGBA32");
break;
case B_RGB24:
context.writeAttr(key, "B_RGB24");
break;
case B_RGB16:
context.writeAttr(key, "B_RGB16");
break;
case B_RGB15:
context.writeAttr(key, "B_RGB15");
break;
case B_RGBA15:
context.writeAttr(key, "B_RGBA15");
break;
case B_CMAP8:
context.writeAttr(key, "B_CMAP8");
break;
case B_GRAY8:
context.writeAttr(key, "B_GRAY8");
break;
case B_GRAY1:
context.writeAttr(key, "B_GRAY1");
break;
case B_RGB32_BIG:
context.writeAttr(key, "B_RGB32_BIG");
break;
case B_RGBA32_BIG:
context.writeAttr(key, "B_RGBA32_BIG");
break;
case B_RGB24_BIG:
context.writeAttr(key, "B_RGB24_BIG");
break;
case B_RGB16_BIG:
context.writeAttr(key, "B_RGB16_BIG");
break;
case B_RGB15_BIG:
context.writeAttr(key, "B_RGB15_BIG");
break;
case B_RGBA15_BIG:
context.writeAttr(key, "B_RGBA15_BIG");
break;
case B_YCbCr422:
context.writeAttr(key, "B_YCbCr422");
break;
case B_YCbCr411:
context.writeAttr(key, "B_YCbCr411");
break;
case B_YCbCr444:
context.writeAttr(key, "B_YCbCr444");
break;
case B_YCbCr420:
context.writeAttr(key, "B_YCbCr420");
break;
case B_YUV422:
context.writeAttr(key, "B_YUV422");
break;
case B_YUV411:
context.writeAttr(key, "B_YUV411");
break;
case B_YUV444:
context.writeAttr(key, "B_YUV444");
break;
case B_YUV420:
context.writeAttr(key, "B_YUV420");
break;
case B_YUV9:
context.writeAttr(key, "B_YUV9");
break;
case B_YUV12:
context.writeAttr(key, "B_YUV12");
break;
case B_UVL24:
context.writeAttr(key, "B_UVL24");
break;
case B_UVL32:
context.writeAttr(key, "B_UVL32");
break;
case B_UVLA32:
context.writeAttr(key, "B_UVLA32");
break;
case B_LAB24:
context.writeAttr(key, "B_LAB24");
break;
case B_LAB32:
context.writeAttr(key, "B_LAB32");
break;
case B_LABA32:
context.writeAttr(key, "B_LABA32");
break;
case B_HSI24:
//.........这里部分代码省略.........
示例12: xmlExportAttributes
void FlatMessageIO::xmlExportAttributes(
ExportContext& context) const {
context.writeAttr("encoding", "base64");
}