Hi all,

I'm working on a 3G Video Call feature atm and I'm a bit stuck with one feature 
implementation. Use case is:

1) User in settings peeks up an image from gallery or from camera as a 
placeholder image for case when during the video call user turns off a camera.
2) User starts/receives a video call.
3) User turns off a camera.

In that case we should start sending peeked placeholder image to an opponent 
instead of a camera stream. So, my questions are:

1) What is the right way to get a setting that is set in settings application 
like this:

      activity.onsuccess = function onPickSuccess() {
        var blob = activity.result.blob;

        if (!blob) {
          return;
        }

        navigator.mozSettings.createLock().set({
          'videoCall.image': blob
        });
      };


Right now I'm using this:

.....................
    nsCOMPtr<nsISettingsService> settings = 
do_GetService("@mozilla.org/settingsService;1");
    nsCOMPtr<nsISettingsServiceLock> settingsLock;
    nsresult rv = settings->CreateLock(nullptr, getter_AddRefs(settingsLock));

    //handling error if rv is not  NS_OK

    nsRefPtr<SettingsGetter> task = new SettingsGetter(this);
    rv = settingsLock->Get(VIDEO_CALL_PLACEHOLDER_IMAGE_PROPERTY_NAME, task);

    //handling error if rv is not  NS_OK
.....................


and I'm getting a JSObject in this nsISettingsServiceCallback::Handle callback:

  // nsISettingsServiceCallback implementation
  NS_IMETHOD Handle(const nsAString& aName, JS::Handle<JS::Value> aResult)
  {
        // here aResult is an object (isObject() returns true).
  }


So, I can't understand how to get something out of this aResult that I can use 
to get a decoded image buffer that might be used to be encoded and placed in an 
outgoing video stream that we send.


2) Second question is 'what is the right/best/fastest way to decode an image'? 
Ideally it would be nice to get a GrallocImage with this image.

I suppose that I should use mozilla::image::ImageFactory class to decode it, 
right?


Thanks in advance for any help,

Kind Regards,
Sergey






SERGEY KASHIN
Principal SW engineer

Symphony Teleca
24 Salganskaya St., Nizhny Novgorod, 603105, Russia
Phone: +78312577232;ext=325
[email protected]<mailto:[email protected]>
www.symphonyteleca.com<http://www.symphonyteleca.com>

[Linkedin]<http://www.linkedin.com/company/4301?trk=tyah>     [Twitter] 
<https://twitter.com/symphony_teleca>      [Facebook] 
<https://www.facebook.com/SymphonyTelecaCorp>
________________________________
[cid:[email protected]]<http://www.symphonyteleca.com/together>


Follow what's going on at Symphony Teleca's blog on 
www.symphonyteleca.com/blog<http://www.symphonyteleca.com/blog>. Please 
consider the environment before you print.

Notice to recipient: This e-mail (including any attachments) is meant for the 
intended recipient only, may contain confidential and proprietary information, 
and is protected by law. If you received this e-mail in error, please 
immediately notify the sender of the error by return e-mail, delete this 
communication and any attachments, and shred any printouts. Unauthorized 
review, use, dissemination, distribution, copying or taking of any action based 
on this communication is strictly prohibited.

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to