← Back to team overview

ubuntu-phone team mailing list archive

Re: Find out if running on a phone

 

Michi,

On Sun, Jan 10, 2016 at 6:15 PM, Michi Henning <michi.henning@xxxxxxxxxxxxx>
wrote:

> > That said, there might be some rare cases where you need info on the
> > currently connected input devices. We're working on an API for that [1]
> > which I think Timo is already looking to add to the images, but it's not
> > landed yet.
>
> Thanks Michael! Is there any doc or header files I can look at? The silo
> doesn’t include an MR link.
>
> > In any case, if you want to know if you are "on a phone or on a
> > desktop", you are probably trying to walk the wrong direction.
>
> This is for the thumbnailer. Depending on whether hardware codecs (phone)
> or software codecs (desktop) are installed, I need to change performance
> tuning parameters. The hardware and software codecs have very different
> timings, and, unfortunately, different semantics. For example, the hardware
> codecs cannot be run concurrently on the device because of a kernel/android
> bug:
>
> https://bugs.launchpad.net/ubuntu/+source/thumbnailer/+bug/1466273


For detecting if there's hardware codecs available, take a look at
gstamchybris [1]. You can use MediaCodecList to enumerate the available
codecs. If it comes back with any it should indicate that you're on a
device that has Android's codec abstraction present, namely
/system/etc/media_codec.xml. This will list both hardware and software
codecs, but none of GStreamer's codecs.


>
> Michi.
>
> >
> > [1] https://requests.ci-train.ubuntu.com/#/ticket/763
> >
> > Hope this helps,
> > Michael
>

[1]
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/gst-plugins-bad1.0/wily/view/head:/sys/androidmedia/gstamchybris.c#L1014

I think this will help accomplish specifically what you're looking for.

Jim


> >
> > --
> > Mailing list: https://launchpad.net/~ubuntu-phone
> > Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~ubuntu-phone
> > More help   : https://help.launchpad.net/ListHelp
>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>

References