Closed
Bug 1144103
Opened 10 years ago
Closed 10 years ago
Support screen recording
Categories
(Firefox OS Graveyard :: GonkIntegration, defect)
Tracking
(firefox45 fixed)
RESOLVED
FIXED
2.6 S1 - 11/20
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: gerard-majax, Assigned: sotaro)
References
Details
(Keywords: dev-doc-needed)
Attachments
(1 file, 14 obsolete files)
16.14 KB,
patch
|
sotaro
:
review+
|
Details | Diff | Splinter Review |
Hacking around in KK, I've sound the |screenrecord| binary on my device. This is built from https://android.googlesource.com/platform/frameworks/av/+/kitkat-mr2.2-release/cmds/screenrecord/screenrecord.cpp
Running it quickly returns me an error:
> ERROR: unable to get display characteristics
Meaning the call to |err = SurfaceComposerClient::getDisplayInfo(mainDpy, &mainDpyInfo);| failed.
I don't know well this part of the system, can we easily leverage this to support screen recording ?
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 1•10 years ago
|
||
ISurfaceComposer's implementation is FakeSurfaceComposer. It implement only necessary few api now in gecko. We need to connect it to GonkDisplayJB and LayerManagerComposite need to support multiple rendering target.
gerard-majax, can I take the bug? This might becomes necessary as basic capability for another capability like WifiDisplay.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 2•10 years ago
|
||
Android's related part is like the following.
https://github.com/sotaroikeda/android-diagrams/blob/master/graphics/DisplayDevice_4.4.pdf?raw=true
Comment 4•10 years ago
|
||
This feature would be really great for automated QA testing, and I hope it gets included in 3.0 feature lists as well. I believe this is essentially same as the eideticker setup without the need for external camera, and perhaps we can do advanced image comparison tests with it.
Updated•10 years ago
|
Blocks: dale-being-happy
Assignee | ||
Comment 5•10 years ago
|
||
Implementing by using nexus-5-l. Recording works, but when finish recording, b2g process reboot.
Assignee | ||
Comment 6•10 years ago
|
||
Fix crash when end recording. Removed redundant logs.
Attachment #8588888 -
Attachment is obsolete: true
Assignee | ||
Comment 8•10 years ago
|
||
attachment 8589163 [details] [diff] [review] have many changes. It seems better to handle some problems by sub bugs.
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8597318 -
Attachment is obsolete: true
Comment 14•10 years ago
|
||
Sotaro, do we have workable screenrecord tool for Aries? Thanks.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 15•10 years ago
|
||
Rebase and kk support.
Attachment #8636558 -
Attachment is obsolete: true
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 16•10 years ago
|
||
Picked change from L. Without this patch. screen record automatically finished very quickly.
Assignee | ||
Comment 17•10 years ago
|
||
(In reply to Bobby Chien [:bchien] from comment #14)
> Sotaro, do we have workable screenrecord tool for Aries? Thanks.
By applying attachment 8682947 [details] [diff] [review] and attachment 8682950 [details] [diff] [review]. I confirmed screenrecord on master aries(KK).
Comment 18•10 years ago
|
||
Sotaro, you mean your patch in comment 17 already landed on master/firefox45, right? Thanks.
Updated•10 years ago
|
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 19•10 years ago
|
||
(In reply to Bobby Chien [:bchien] from comment #18)
> Sotaro, you mean your patch in comment 17 already landed on
> master/firefox45, right? Thanks.
They are not landed to yet.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 20•10 years ago
|
||
I created the patches in comment 17 yesterday and applied local master aries environment.
Assignee | ||
Updated•10 years ago
|
Attachment #8682950 -
Attachment is obsolete: true
Assignee | ||
Comment 22•10 years ago
|
||
Code clean up.
Attachment #8687749 -
Attachment is obsolete: true
Assignee | ||
Comment 23•10 years ago
|
||
Add a comment.
Attachment #8687776 -
Attachment is obsolete: true
Assignee | ||
Comment 24•10 years ago
|
||
Fix build failure on JB.
Attachment #8687778 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8687785 -
Flags: review?(mwu)
Assignee | ||
Updated•10 years ago
|
Attachment #8687785 -
Flags: review?(mwu)
Assignee | ||
Comment 25•10 years ago
|
||
Add pref check.
Attachment #8687785 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8687789 -
Flags: review?(mwu)
Comment 26•10 years ago
|
||
Comment on attachment 8687789 [details] [diff] [review]
patch - Add Screen recording capability
Review of attachment 8687789 [details] [diff] [review]:
-----------------------------------------------------------------
Looks fine overall, though I guess we might want to rename FakeSurfaceComposer to GeckoSurfaceComposer later since so much is implemented now. r=me with nits, locking, and density detection fixed.
::: widget/gonk/nativewindow/FakeSurfaceComposer.cpp
@@ +78,5 @@
> + MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
> + RefPtr<nsScreenManagerGonk> screenManager =
> + nsScreenManagerGonk::GetInstance();
> + screenManager->RemoveScreen(GonkDisplay::DISPLAY_VIRTUAL);
> + mComposer->mDisplays.removeItemsAt(mIndex);
Displays are added to mDisplay on another thread but removed on the main thread. A lock is taken for adding the display, but not for removal, so I'm not sure how it's safe.
@@ +107,5 @@
> + : composer(composer) {
> + }
> + };
> +
> + if(!gfxPrefs::ScreenRecordingEnabled()) {
nit: space after if
@@ +178,5 @@
> +
> + uint32_t flags = 0;
> + DisplayDeviceState& disp(mDisplays.editValueAt(dpyIdx));
> +
> + if (disp.isValid()) {
nit: early return here to avoid an indenting the rest of the function.
@@ +411,5 @@
> + if (Density::getEmuDensity()) {
> + // if "qemu.sf.lcd_density" is specified, it overrides everything
> + xdpi = ydpi = density = Density::getEmuDensity();
> + density /= 160.0f;
> + }
I think we should remove all this density logic and just use screen->GetDpi(). That's what gecko actually thinks the DPI is.
::: widget/gonk/nativewindow/FakeSurfaceComposer.h
@@ +31,5 @@
> +#include <hardware/hwcomposer.h>
> +#include <private/gui/LayerState.h>
> +#include <utils/KeyedVector.h>
> +
> +#include "nsCOMPtr.h"
Does this need to be here? I don't see nsCOMPtrs used in this header.
@@ +128,5 @@
> +
> + struct DisplayDeviceState {
> + enum {
> + NO_LAYER_STACK = 0xFFFFFFFF,
> + };
nit: indentation
@@ +152,5 @@
> + };
> +
> + // access must be protected by mStateLock
> + mutable Mutex mStateLock;
> + DefaultKeyedVector< wp<IBinder>, DisplayDeviceState> mDisplays;
nit: remove the space before wp, if possible.
Attachment #8687789 -
Flags: review?(mwu) → review+
Assignee | ||
Comment 27•10 years ago
|
||
(In reply to Michael Wu [:mwu] from comment #26)
> Comment on attachment 8687789 [details] [diff] [review]
> patch - Add Screen recording capability
>
> Review of attachment 8687789 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Looks fine overall, though I guess we might want to rename
> FakeSurfaceComposer to GeckoSurfaceComposer later since so much is
> implemented now. r=me with nits, locking, and density detection fixed.
I am going to update the class name in a different bug.
>
> ::: widget/gonk/nativewindow/FakeSurfaceComposer.cpp
> @@ +78,5 @@
> > + MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
> > + RefPtr<nsScreenManagerGonk> screenManager =
> > + nsScreenManagerGonk::GetInstance();
> > + screenManager->RemoveScreen(GonkDisplay::DISPLAY_VIRTUAL);
> > + mComposer->mDisplays.removeItemsAt(mIndex);
>
> Displays are added to mDisplay on another thread but removed on the main
> thread. A lock is taken for adding the display, but not for removal, so I'm
> not sure how it's safe.
Thanks, loch is necessary for removal. I will update it in a next patch.
>
> @@ +107,5 @@
> > + : composer(composer) {
> > + }
> > + };
> > +
> > + if(!gfxPrefs::ScreenRecordingEnabled()) {
>
> nit: space after if
I'll update it in a next patch.
>
> @@ +178,5 @@
> > +
> > + uint32_t flags = 0;
> > + DisplayDeviceState& disp(mDisplays.editValueAt(dpyIdx));
> > +
> > + if (disp.isValid()) {
>
> nit: early return here to avoid an indenting the rest of the function.
I'll update it in a next patch.
>
> @@ +411,5 @@
> > + if (Density::getEmuDensity()) {
> > + // if "qemu.sf.lcd_density" is specified, it overrides everything
> > + xdpi = ydpi = density = Density::getEmuDensity();
> > + density /= 160.0f;
> > + }
>
> I think we should remove all this density logic and just use
> screen->GetDpi(). That's what gecko actually thinks the DPI is.
Thanks. I'll update in a next patch.
>
> ::: widget/gonk/nativewindow/FakeSurfaceComposer.h
> @@ +31,5 @@
> > +#include <hardware/hwcomposer.h>
> > +#include <private/gui/LayerState.h>
> > +#include <utils/KeyedVector.h>
> > +
> > +#include "nsCOMPtr.h"
>
> Does this need to be here? I don't see nsCOMPtrs used in this header.
Until previous patch, it was necessary. I'll update it in a next patch.
>
> @@ +128,5 @@
> > +
> > + struct DisplayDeviceState {
> > + enum {
> > + NO_LAYER_STACK = 0xFFFFFFFF,
> > + };
>
> nit: indentation
I'll update it in a next patch.
>
> @@ +152,5 @@
> > + };
> > +
> > + // access must be protected by mStateLock
> > + mutable Mutex mStateLock;
> > + DefaultKeyedVector< wp<IBinder>, DisplayDeviceState> mDisplays;
>
> nit: remove the space before wp, if possible.
I'll update it in a next patch.
Assignee | ||
Comment 28•10 years ago
|
||
Apply the comment. Carry "r=mwu".
Attachment #8687789 -
Attachment is obsolete: true
Attachment #8688271 -
Flags: review+
Assignee | ||
Comment 29•10 years ago
|
||
Comment 30•10 years ago
|
||
Comment 31•10 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 2.6 S1 - 11/20
Comment 32•10 years ago
|
||
Hey Sotaro, could you quickly share how this works ? A pointer to an Internet resource works too :)
Flags: needinfo?(sotaro.ikeda.g)
Reporter | ||
Comment 33•10 years ago
|
||
Flip the pref layers.screen-recording.enabled, then adb shell; screenrecord /path/to/mp4
Updated•10 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 35•10 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #33)
> Flip the pref layers.screen-recording.enabled, then adb shell; screenrecord /path/to/mp4
Thanks. It should works on gonk kk and gonk L devices.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 36•10 years ago
|
||
I checked only on nexus-5-l and aries. I am going to check it on flame-kk.
Assignee | ||
Comment 37•10 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #36)
> I checked only on nexus-5-l and aries. I am going to check it on flame-kk.
flame-kk also works by "adb shell screenrecord /sdcard/screenrecord.mp4" with the pref enabled.
Comment 38•10 years ago
|
||
Hi Sotaro, I can't find layers.screen-recording.enabled in latest nexus-5-l build. Any trick? :)
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 39•10 years ago
|
||
(In reply to Bobby Chien [:bchien] from comment #38)
> Hi Sotaro, I can't find layers.screen-recording.enabled in latest nexus-5-l
> build. Any trick? :)
It is because it is disabled by default.
https://dxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxPrefs.h#317
Flags: needinfo?(sotaro.ikeda.g)
Comment 40•10 years ago
|
||
Sotaro, nexus 5 screenrecord is 16 fps per my own testing. Does it able to record as 30 or 60 fps? Thanks.
Flags: needinfo?(sotaro.ikeda.g)
Assignee | ||
Comment 41•10 years ago
|
||
(In reply to Bobby Chien [:bchien] from comment #40)
> Sotaro, nexus 5 screenrecord is 16 fps per my own testing. Does it able to
> record as 30 or 60 fps? Thanks.
Without modification of the code, it might be not possible. Optimization rendering path need to be implemented.
Flags: needinfo?(sotaro.ikeda.g)
Comment 42•10 years ago
|
||
Thanks so much for this sotaro!
You need to log in
before you can comment on or make changes to this bug.
Description
•