~ci-train-bot/media-hub/media-hub-ubuntu-yakkety-1823

« back to all changes in this revision

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

  • Committer: Jim Hodapp
  • Date: 2016-08-15 19:27:29 UTC
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: jim.hodapp@canonical.com-20160815192729-0nxsgwdg80tm588x
Expose the backend selection to the stub side

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
        in = static_cast<core::ubuntu::media::Player::PlaybackStatus>(out.pop_int16());
193
193
    }
194
194
};
 
195
 
 
196
namespace helper
 
197
{
 
198
template<>
 
199
struct TypeMapper<core::ubuntu::media::AVBackend::Backend>
 
200
{
 
201
    constexpr static ArgumentType type_value()
 
202
    {
 
203
        return core::dbus::ArgumentType::int16;
 
204
    }
 
205
    constexpr static bool is_basic_type()
 
206
    {
 
207
        return false;
 
208
    }
 
209
    constexpr static bool requires_signature()
 
210
    {
 
211
        return false;
 
212
    }
 
213
 
 
214
    static std::string signature()
 
215
    {
 
216
        static const std::string s = TypeMapper<std::int16_t>::signature();
 
217
        return s;
 
218
    }
 
219
};
 
220
}
 
221
 
 
222
template<>
 
223
struct Codec<core::ubuntu::media::AVBackend::Backend>
 
224
{
 
225
    static void encode_argument(core::dbus::Message::Writer& out,
 
226
                const core::ubuntu::media::AVBackend::Backend& in)
 
227
    {
 
228
        out.push_int16(static_cast<std::int16_t>(in));
 
229
    }
 
230
 
 
231
    static void decode_argument(core::dbus::Message::Reader& out,
 
232
                core::ubuntu::media::AVBackend::Backend& in)
 
233
    {
 
234
        in = static_cast<core::ubuntu::media::AVBackend::Backend>(out.pop_int16());
 
235
    }
 
236
};
 
237
 
195
238
namespace helper
196
239
{
197
240
template<>