~thomas-voss/media-hub/add-display-controller-interface

« back to all changes in this revision

Viewing changes to src/core/media/codec.h

* Refactor client-facing interfaces to pull out explicit dependency on hybris-based media layer.
[ Ubuntu daily release ]
* New rebuild forced
[ Justin McPherson ]
* #1239432 Music fails to pause on incoming/outgoing calls (LP:
  #1239432)
[ thomas-voss ]
* Bump build dependency on dbus-cpp to pull in exception safe dtor.
  (LP: #1390618)

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
    }
231
231
};
232
232
 
 
233
namespace helper
 
234
{
 
235
template<core::ubuntu::media::video::detail::DimensionTag tag, typename IntegerType>
 
236
struct TypeMapper<core::ubuntu::media::video::detail::IntWrapper<tag, IntegerType>>
 
237
{
 
238
    constexpr static ArgumentType type_value()
 
239
    {
 
240
        return core::dbus::ArgumentType::uint32;
 
241
    }
 
242
    constexpr static bool is_basic_type()
 
243
    {
 
244
        return true;
 
245
    }
 
246
    constexpr static bool requires_signature()
 
247
    {
 
248
        return false;
 
249
    }
 
250
 
 
251
    static std::string signature()
 
252
    {
 
253
        static const std::string s = TypeMapper<std::uint32_t>::signature();
 
254
        return s;
 
255
    }
 
256
};
 
257
}
 
258
 
 
259
template<core::ubuntu::media::video::detail::DimensionTag tag, typename IntegerType>
 
260
struct Codec<core::ubuntu::media::video::detail::IntWrapper<tag, IntegerType>>
 
261
{
 
262
    static void encode_argument(core::dbus::Message::Writer& out, const core::ubuntu::media::video::detail::IntWrapper<tag, IntegerType>& in)
 
263
    {
 
264
        out.push_uint32(in.template as<std::uint32_t>());
 
265
    }
 
266
 
 
267
    static void decode_argument(core::dbus::Message::Reader& out, core::ubuntu::media::video::detail::IntWrapper<tag, IntegerType>& in)
 
268
    {
 
269
        in = core::ubuntu::media::video::detail::IntWrapper<tag, IntegerType>{out.pop_uint32()};
 
270
    }
 
271
};
 
272
 
233
273
}
234
274
}
235
275