Media nodes: Add missing "const" around usages of media format wildcards.
This commit is contained in:
parent
1640b4de64
commit
7ba8de3cac
@ -569,7 +569,7 @@ EqualizerNode::ValidateFormat(const media_format &preferred_format,
|
|||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
media_raw_audio_format &wild = media_raw_audio_format::wildcard;
|
const media_raw_audio_format &wild = media_raw_audio_format::wildcard;
|
||||||
media_raw_audio_format &f = proposed_format.u.raw_audio;
|
media_raw_audio_format &f = proposed_format.u.raw_audio;
|
||||||
const media_raw_audio_format &pref = preferred_format.u.raw_audio;
|
const media_raw_audio_format &pref = preferred_format.u.raw_audio;
|
||||||
|
|
||||||
@ -614,7 +614,7 @@ void
|
|||||||
EqualizerNode::SetOutputFormat(media_format &format)
|
EqualizerNode::SetOutputFormat(media_format &format)
|
||||||
{
|
{
|
||||||
media_raw_audio_format &f = format.u.raw_audio;
|
media_raw_audio_format &f = format.u.raw_audio;
|
||||||
media_raw_audio_format &w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format &w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
if (f.frame_rate == w.frame_rate) {
|
if (f.frame_rate == w.frame_rate) {
|
||||||
f.frame_rate = 44100.0;
|
f.frame_rate = 44100.0;
|
||||||
|
@ -552,7 +552,7 @@ VSTNode::ValidateFormat(const media_format &preferredFormat,
|
|||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
media_raw_audio_format &wild = media_raw_audio_format::wildcard;
|
const media_raw_audio_format &wild = media_raw_audio_format::wildcard;
|
||||||
media_raw_audio_format &f = proposedFormat.u.raw_audio;
|
media_raw_audio_format &f = proposedFormat.u.raw_audio;
|
||||||
const media_raw_audio_format &pref = preferredFormat.u.raw_audio;
|
const media_raw_audio_format &pref = preferredFormat.u.raw_audio;
|
||||||
|
|
||||||
@ -597,7 +597,7 @@ void
|
|||||||
VSTNode::SetOutputFormat(media_format &format)
|
VSTNode::SetOutputFormat(media_format &format)
|
||||||
{
|
{
|
||||||
media_raw_audio_format &f = format.u.raw_audio;
|
media_raw_audio_format &f = format.u.raw_audio;
|
||||||
media_raw_audio_format &w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format &w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
if (f.frame_rate == w.frame_rate)
|
if (f.frame_rate == w.frame_rate)
|
||||||
f.frame_rate = 44100.0;
|
f.frame_rate = 44100.0;
|
||||||
|
@ -545,7 +545,7 @@ void export_raw_audio_attr(
|
|||||||
const media_raw_audio_format& f,
|
const media_raw_audio_format& f,
|
||||||
ExportContext& context) {
|
ExportContext& context) {
|
||||||
|
|
||||||
media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
if(f.frame_rate != w.frame_rate)
|
if(f.frame_rate != w.frame_rate)
|
||||||
context.writeAttr(gKey_frame_rate, f.frame_rate);
|
context.writeAttr(gKey_frame_rate, f.frame_rate);
|
||||||
@ -587,7 +587,7 @@ void export_multi_audio_info_attr(
|
|||||||
const media_multi_audio_info& f,
|
const media_multi_audio_info& f,
|
||||||
ExportContext& context) {
|
ExportContext& context) {
|
||||||
|
|
||||||
media_multi_audio_format& w = media_multi_audio_format::wildcard;
|
const media_multi_audio_format& w = media_multi_audio_format::wildcard;
|
||||||
|
|
||||||
if(f.channel_mask != w.channel_mask)
|
if(f.channel_mask != w.channel_mask)
|
||||||
context.writeAttr(gKey_channel_mask, f.channel_mask);
|
context.writeAttr(gKey_channel_mask, f.channel_mask);
|
||||||
@ -603,7 +603,7 @@ void export_video_display_info_attr(
|
|||||||
const media_video_display_info& d,
|
const media_video_display_info& d,
|
||||||
ExportContext& context) {
|
ExportContext& context) {
|
||||||
|
|
||||||
media_video_display_info& w = media_video_display_info::wildcard;
|
const media_video_display_info& w = media_video_display_info::wildcard;
|
||||||
|
|
||||||
if(d.line_width != w.line_width)
|
if(d.line_width != w.line_width)
|
||||||
context.writeAttr(gKey_line_width, d.line_width);
|
context.writeAttr(gKey_line_width, d.line_width);
|
||||||
@ -625,7 +625,7 @@ void export_raw_video_attr(
|
|||||||
const media_raw_video_format& f,
|
const media_raw_video_format& f,
|
||||||
ExportContext& context) {
|
ExportContext& context) {
|
||||||
|
|
||||||
media_raw_video_format& w = media_raw_video_format::wildcard;
|
const media_raw_video_format& w = media_raw_video_format::wildcard;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
if(f.field_rate != w.field_rate)
|
if(f.field_rate != w.field_rate)
|
||||||
@ -743,7 +743,7 @@ void export_multistream_attr(
|
|||||||
const media_multistream_format& f,
|
const media_multistream_format& f,
|
||||||
ExportContext& context) {
|
ExportContext& context) {
|
||||||
|
|
||||||
media_multistream_format& w = media_multistream_format::wildcard;
|
const media_multistream_format& w = media_multistream_format::wildcard;
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
switch(f.format) {
|
switch(f.format) {
|
||||||
@ -813,7 +813,7 @@ void export_encoded_audio_attr(
|
|||||||
const media_encoded_audio_format& f,
|
const media_encoded_audio_format& f,
|
||||||
ExportContext& context) {
|
ExportContext& context) {
|
||||||
|
|
||||||
media_encoded_audio_format& w = media_encoded_audio_format::wildcard;
|
const media_encoded_audio_format& w = media_encoded_audio_format::wildcard;
|
||||||
|
|
||||||
switch(f.encoding) {
|
switch(f.encoding) {
|
||||||
case media_encoded_audio_format::B_ANY:
|
case media_encoded_audio_format::B_ANY:
|
||||||
@ -848,7 +848,7 @@ void export_encoded_video_attr(
|
|||||||
const media_encoded_video_format& f,
|
const media_encoded_video_format& f,
|
||||||
ExportContext& context) {
|
ExportContext& context) {
|
||||||
|
|
||||||
media_encoded_video_format& w = media_encoded_video_format::wildcard;
|
const media_encoded_video_format& w = media_encoded_video_format::wildcard;
|
||||||
|
|
||||||
switch(f.encoding) {
|
switch(f.encoding) {
|
||||||
case media_encoded_video_format::B_ANY:
|
case media_encoded_video_format::B_ANY:
|
||||||
|
@ -109,7 +109,7 @@ status_t _AudioAdapterNode::getPreferredInputFormat(
|
|||||||
ASSERT(p);
|
ASSERT(p);
|
||||||
|
|
||||||
media_raw_audio_format& f = ioFormat.u.raw_audio;
|
media_raw_audio_format& f = ioFormat.u.raw_audio;
|
||||||
media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
// copy user preferences
|
// copy user preferences
|
||||||
if(p->inputFormat.format != w.format)
|
if(p->inputFormat.format != w.format)
|
||||||
@ -182,7 +182,7 @@ status_t _AudioAdapterNode::getPreferredOutputFormat(
|
|||||||
_AudioAdapterParams* p = dynamic_cast<_AudioAdapterParams*>(parameterSet());
|
_AudioAdapterParams* p = dynamic_cast<_AudioAdapterParams*>(parameterSet());
|
||||||
ASSERT(p);
|
ASSERT(p);
|
||||||
|
|
||||||
media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
// copy user preferences
|
// copy user preferences
|
||||||
if(p->outputFormat.format != w.format)
|
if(p->outputFormat.format != w.format)
|
||||||
@ -223,7 +223,7 @@ status_t _AudioAdapterNode::validateProposedInputFormat(
|
|||||||
status_t err = _inherited::validateProposedInputFormat(
|
status_t err = _inherited::validateProposedInputFormat(
|
||||||
preferredFormat, ioProposedFormat);
|
preferredFormat, ioProposedFormat);
|
||||||
|
|
||||||
media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
if(output().destination != media_destination::null) {
|
if(output().destination != media_destination::null) {
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ status_t _AudioAdapterNode::validateProposedOutputFormat(
|
|||||||
status_t err = _inherited::validateProposedOutputFormat(
|
status_t err = _inherited::validateProposedOutputFormat(
|
||||||
preferredFormat, ioProposedFormat);
|
preferredFormat, ioProposedFormat);
|
||||||
|
|
||||||
media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
if(input().source != media_source::null) {
|
if(input().source != media_source::null) {
|
||||||
|
|
||||||
|
@ -1143,7 +1143,7 @@ status_t FlangerNode::validateProposedFormat(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wildcard format
|
// wildcard format
|
||||||
media_raw_audio_format& wild = media_raw_audio_format::wildcard;
|
const media_raw_audio_format& wild = media_raw_audio_format::wildcard;
|
||||||
// proposed format
|
// proposed format
|
||||||
media_raw_audio_format& f = ioProposedFormat.u.raw_audio;
|
media_raw_audio_format& f = ioProposedFormat.u.raw_audio;
|
||||||
// template format
|
// template format
|
||||||
@ -1212,7 +1212,7 @@ void FlangerNode::specializeOutputFormat(
|
|||||||
|
|
||||||
// carpal_tunnel_paranoia
|
// carpal_tunnel_paranoia
|
||||||
media_raw_audio_format& f = ioFormat.u.raw_audio;
|
media_raw_audio_format& f = ioFormat.u.raw_audio;
|
||||||
media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
const media_raw_audio_format& w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
if (f.frame_rate == w.frame_rate)
|
if (f.frame_rate == w.frame_rate)
|
||||||
f.frame_rate = 44100.0;
|
f.frame_rate = 44100.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user