当前位置: 首页>>代码示例>>C++>>正文


C++ ExportContext类代码示例

本文整理汇总了C++中ExportContext的典型用法代码示例。如果您正苦于以下问题:C++ ExportContext类的具体用法?C++ ExportContext怎么用?C++ ExportContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ExportContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:8,代码来源:MediaFormatIO.cpp

示例2: export_raw_video_content

void export_raw_video_content(
	const media_raw_video_format& f,
	ExportContext& context) {
	
	context.beginContent();
	context.beginElement(MediaFormatIO::s_video_display_info_tag);
	export_video_display_info_attr(f.display, context);
	context.endElement();
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:9,代码来源:MediaFormatIO.cpp

示例3: export_encoded_video_content

void export_encoded_video_content(
	const media_encoded_video_format& f,
	ExportContext& context) {

	context.beginContent();

	context.beginElement(MediaFormatIO::s_raw_video_tag);
	export_raw_video_attr(f.output, context);
	context.endElement();
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:10,代码来源:MediaFormatIO.cpp

示例4: xmlExportBegin

// -------------------------------------------------------- //
void ConnectionIO::xmlExportBegin(
    ExportContext&						context) const {

    if(!m_exportValid) {
        context.reportError(
            "ConnectionIO::xmlExportBegin():\n"
            "*** invalid ***\n");
        return;
    }

    context.beginElement(_CONNECTION_ELEMENT);
}
开发者ID:yunxiaoxiao110,项目名称:haiku,代码行数:13,代码来源:ConnectionIO.cpp

示例5: 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);
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:13,代码来源:MediaFormatIO.cpp

示例6: 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;
	}
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:31,代码来源:MediaFormatIO.cpp

示例7: export_multistream_content

void export_multistream_content(
	const media_multistream_format& f,
	ExportContext& context) {

	context.beginContent();
	
	// write flags
	context.beginElement(MediaFormatIO::s_multistream_flags_tag);
	export_multistream_flags_attr(f.flags, context);
	context.endElement();
	
	// write format-specific info
	if(f.format == media_multistream_format::B_VID) {
		context.beginElement(MediaFormatIO::s_multistream_vid_info_tag);
		export_multistream_vid_info_attr(f.u.vid, context);
		context.endElement();
	}
	else if(f.format == media_multistream_format::B_AVI) {
		context.beginElement(MediaFormatIO::s_multistream_avi_info_tag);
		export_multistream_avi_info_attr(f.u.avi, context);
		context.beginContent();
		export_multistream_avi_info_content(f.u.avi, context);
		context.endElement();
	}
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:25,代码来源:MediaFormatIO.cpp

示例8: export_encoded_audio_content

void export_encoded_audio_content(
	const media_encoded_audio_format& f,
	ExportContext& context) {
	
	context.beginContent();

	context.beginElement(MediaFormatIO::s_raw_audio_tag);
	export_raw_audio_attr(f.output, context);

#if B_BEOS_VERSION > B_BEOS_VERSION_4_5
	export_multi_audio_info_attr(f.multi_info, context);
#endif

	context.endElement();
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:15,代码来源:MediaFormatIO.cpp

示例9: 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);
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:15,代码来源:MediaFormatIO.cpp

示例10: export_multistream_avi_info_content

void export_multistream_avi_info_content(
	media_multistream_format::avi_info f,
	ExportContext& context) {

	context.beginContent();
		
	for(uint16 n = 0; n < f.type_count; ++n)
		write_media_type(f.types[n], context);
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:9,代码来源:MediaFormatIO.cpp

示例11: xmlExportBegin

__USE_CORTEX_NAMESPACE

// -------------------------------------------------------- //
// EXPORT [not implemented]
// -------------------------------------------------------- //

void StringContent::xmlExportBegin(
	ExportContext&								context) const {
	context.reportError("StringContent: no export");
}	
开发者ID:mariuz,项目名称:haiku,代码行数:10,代码来源:StringContent.cpp

示例12: xmlExportContent

void FlatMessageIO::xmlExportContent(
	ExportContext& context) const {

	context.beginContent();

	// convert message to base64
	ASSERT(m_message);
	ssize_t flatSize = m_message->FlattenedSize();
	ASSERT(flatSize);
	char* flatData = new char[flatSize];
	status_t err = m_message->Flatten(flatData, flatSize);
	ASSERT(err == B_OK);
	
	// make plenty of room for encoded content (encode_base64 adds newlines)
	ssize_t base64Size = ((flatSize * 3) / 2);
	char* base64Data = new char[base64Size];
	ssize_t base64Used = encode_base64(base64Data, flatData, flatSize);
	base64Data[base64Used] = '\0';
	
	// write the data

	const char* pos = base64Data;
	while(*pos) {
		ssize_t chunk = 0;
		const char* nextBreak = strchr(pos, '\n');
		if(!nextBreak)
			chunk = strlen(pos);
		else
			chunk = nextBreak - pos;

		context.writeString(context.indentString());
		context.writeString(pos, chunk);
		context.writeString("\n");
		
		pos += chunk;
		if(*pos == '\n')
			++pos;
	}
	
	// clean up
	delete [] flatData;
	delete [] base64Data;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:43,代码来源:FlatMessageIO.cpp

示例13: 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);
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:20,代码来源:MediaFormatIO.cpp

示例14: 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);
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:20,代码来源:MediaFormatIO.cpp

示例15: 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);
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:25,代码来源:MediaFormatIO.cpp


注:本文中的ExportContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。