aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/convert/convert_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/convert/convert_impl.cpp')
-rw-r--r--host/lib/convert/convert_impl.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/host/lib/convert/convert_impl.cpp b/host/lib/convert/convert_impl.cpp
index 329e94a4d..d90bb9c94 100644
--- a/host/lib/convert/convert_impl.cpp
+++ b/host/lib/convert/convert_impl.cpp
@@ -43,10 +43,10 @@ bool convert::operator==(const convert::id_type &lhs, const convert::id_type &rh
std::string convert::id_type::to_pp_string(void) const{
return str(boost::format(
"conversion ID\n"
- " Input format: %s\n"
- " Num inputs: %d\n"
+ " Input format: %s\n"
+ " Num inputs: %d\n"
" Output format: %s\n"
- " Num outputs: %d\n"
+ " Num outputs: %d\n"
)
% this->input_format
% this->num_inputs
@@ -55,6 +55,15 @@ std::string convert::id_type::to_pp_string(void) const{
);
}
+std::string convert::id_type::to_string(void) const{
+ return str(boost::format("%s (%d) -> %s (%d)")
+ % this->input_format
+ % this->num_inputs
+ % this->output_format
+ % this->num_outputs
+ );
+}
+
/***********************************************************************
* Setup the table registry
**********************************************************************/
@@ -92,7 +101,15 @@ convert::function_type convert::get_converter(
//find a matching priority
priority_type best_prio = -1;
BOOST_FOREACH(priority_type prio_i, get_table()[id].keys()){
- if (prio_i == prio) return get_table()[id][prio];
+ if (prio_i == prio) {
+ //----------------------------------------------------------------//
+ UHD_LOGV(always) << "get_converter: For converter ID: " << id.to_pp_string() << std::endl
+ << "Using prio: " << prio << std::endl
+ << std::endl
+ ;
+ //----------------------------------------------------------------//
+ return get_table()[id][prio];
+ }
best_prio = std::max(best_prio, prio_i);
}
@@ -100,6 +117,13 @@ convert::function_type convert::get_converter(
if (prio != -1) throw uhd::key_error(
"Cannot find a conversion routine [with prio] for " + id.to_pp_string());
+ //----------------------------------------------------------------//
+ UHD_LOGV(always) << "get_converter: For converter ID: " << id.to_pp_string() << std::endl
+ << "Using prio: " << best_prio << std::endl
+ << std::endl
+ ;
+ //----------------------------------------------------------------//
+
//otherwise, return best prio
return get_table()[id][best_prio];
}
@@ -148,6 +172,7 @@ UHD_STATIC_BLOCK(convert_register_item_sizes){
convert::register_bytes_per_item("s32", sizeof(boost::int32_t));
convert::register_bytes_per_item("s16", sizeof(boost::int16_t));
convert::register_bytes_per_item("s8", sizeof(boost::int8_t));
+ convert::register_bytes_per_item("u8", sizeof(boost::uint8_t));
//register VITA types
convert::register_bytes_per_item("item32", sizeof(boost::int32_t));