0
Commit Graph

22 Commits

Author SHA1 Message Date
Lei Zhang
a3ba1210f7 Swap ref_counted.h for scoped_refptr.h when appropriate in //ppapi.
At some point, scoped_refptr got split off into its own header. Use it
in //ppapi headers when appropriate.

Bug: 1381627
Change-Id: Ie5b6b3cb2800e73b7bb801bc1e8218aa6848cb40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4011499
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1071907}
2022-11-15 23:41:31 +00:00
Avi Drissman
db497b3200 Update copyright headers in pdf/, ppapi/, printing/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c95.

No-Try: true
Bug: 1098010
Change-Id: I6ae92e5d7ccbf73b176588124b2f8b4067f805b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900575
Reviewed-by: Mark Mentovai <mark@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047628}
2022-09-15 19:47:28 +00:00
Peter Boström
5666ff4f50 Remove most remaining unused "base/macros.h"
Removes `#include "base/macros.h"` from remaining .cc, .h and .mm files
that do not contain `ignore_result(` and do not trigger pre-commit or
pre-upload errors.

Bug: 1010217
No-Try: true
Change-Id: I4cc5207b3deafa7901764d2e633bbb1ad43cfb73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276692
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941054}
2021-11-12 03:40:24 +00:00
Peter Boström
3d5b3cbc71 Replace DISALLOW_COPY_AND_ASSIGN in ppapi/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: Iab44b67c7ca86cf5cfb1f6b27de5c18769d36632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3177680
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#924479}
2021-09-23 21:35:45 +00:00
Matthew Cary
66e4f70d12 PPAPI: Upgrade video decoder host shared memory API.
Use an UnsafeSharedMemoryRegion instead of the existing handle. The
shared memory on the host side is used read-only, but because a
writable region needs to be shipped to the other side of the proxy, an
unsafe region needs to be used.

Host                         | Other side of proxy
-----------------------------+---------------------------------
                             |   Request SHM
 Create SHM <-----------------------/
 Reply with SHM Handle       |
   | \-------------------------> Receive SHM
 Save SHM by ID              |
                             |
                             |   Fill SHM with video to decode
                             |       (write to SHM)
                             |   Send SHM ID to Host
 Receive decode request <-----------/
 Look up buffer by ID        |
 Decode what's in the SHM    |
  (read-only SHM access)

The host-side could use a read-only region only by adding an additional
round-trip, with the other side of the proxy either converting to
read-only after mapping writable, and shipping back to the host,
or the other side of the proxy mapping, shipping back a writable
handle, and then the host converting to read-only. This has not been
done in this CL.

Bug: 849207
Change-Id: I3e50f9ff9c65e51c21c7e4d72b3aed2402c03196
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615021
Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666194}
2019-06-05 08:47:52 +00:00
Takuto Ikuta
fc262dcd40 Remove include of base/containers/hash_tables.h except base/
Added some unordered_map/unordered_set include instead to fix build.

Bug: 576864
TBR: thakis@chromium.org
Change-Id: I8a23d908af392ced8fb2df0073e64e8020acc5fd
Reviewed-on: https://chromium-review.googlesource.com/c/1398161
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620639}
2019-01-08 06:26:58 +00:00
Takuto Ikuta
adf31eb3e5 Replace base::hash_map with std::unordered_map
base::hash_map is alias of std::unordered_map now.

I applied following command to make this CL.

$ git grep -l 'base::hash_map' | fgrep -v base/ | xargs sed -i -e 's/base::hash_map/std::unordered_set/g' -e 's/\(#include <[a-z_]*>\)/\1\n#include <unordered_map>/' -e 's/BASE_HASH_NAMESPACE/std/'
$ git cl format
$ # Added IntPairHash and replaced BASE_HASH_NAMESPACE with std in some places.

TBR: dcheng@chromium.org
Bug: 576864
Change-Id: I38941d9f9bcb05ec474b8dee5230c4c5dcd2211f
Reviewed-on: https://chromium-review.googlesource.com/c/1390892
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620124}
2019-01-05 00:32:48 +00:00
Antoine Labour
04cb3b28bc PPB_VideoDecoder: create mailbox names on the plugin side
For obscure historical reasons, mailbox names were created on the
renderer side whereas the textures are produced on the plugin side. Move
the mailbox name creation to the plugin side so that it happens when the
textures are produced. A follow-up will merge the 2 operations.

Bug: 847674
Change-Id: Ia8cde57c2c0421e1361ddb14de63f02a34ea9b6f
Reviewed-on: https://chromium-review.googlesource.com/1081669
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563858}
2018-06-01 23:25:10 +00:00
Brett Wilson
b02c0a23ba Replace std::queue with base::queue.
We are standardizing on the base implementation whenever possible.

Updates typedefs to using statements when code was changed.

file_transfer_message_handler_unittest.cc got a new helper function
since base::queue lacks an operator== required for gtest.

Bug: 757232
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I98d0c6880a5fcf5d236634abca51ba0fe41eeb6c
Reviewed-on: https://chromium-review.googlesource.com/682755
Commit-Queue: Brett Wilson <brettw@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504191}
2017-09-25 22:34:42 +00:00
avi
9bf1749589 Remove ScopedVector from ppapi/.
BUG=554289

Review-Url: https://codereview.chromium.org/2972053003
Cr-Commit-Position: refs/heads/master@{#485173}
2017-07-10 02:19:38 +00:00
jbriance
3fc7042061 ppapi: Cleanup class/struct forward declarations
Remove useless class and struct forward declarations, and add
missing ones in ppapi header files.

BUG=662195

Review-Url: https://codereview.chromium.org/2539033005
Cr-Commit-Position: refs/heads/master@{#436167}
2016-12-03 20:53:35 +00:00
dcheng
ced9224fbb Convert //ppapi to use std::unique_ptr
BUG=554298
R=bbudge@chromium.org

Review URL: https://codereview.chromium.org/1864293002

Cr-Commit-Position: refs/heads/master@{#385591}
2016-04-07 00:01:36 +00:00
avi
e029c4134f Switch to standard integer types in ppapi/.
BUG=138542
TBR=bbudge@chromium.org
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1548813002

Cr-Commit-Position: refs/heads/master@{#366718}
2015-12-23 06:46:20 +00:00
lpique
9dd55e546c Introduce a client minimum picture pool size
When using the video decoder PPAPI, the most recent version of the ARC extension requires there to be a certain minimum number of picture buffers in flight (allocated but not released). Without a larger pool, ARC video decoding will stall trying to allocate more decoded picture frames than are available by default.

This patch creates a new DEV interface version for the VideoDecoder PPAPI. The new interface simply adds a single new argument to VideoDecoder::Initialize() so that a PPAPI client indicate the minimum number of pictures it needs to function.

In order to implement this minium picture count, the meaning of the ProvidePictureBuffers() interface call used by the video decoder implementations has changed slightly. After making the call to ProvidePictureBuffers() with a given picture buffer size, the subsequent callback via AssignPictureBuffers() includes a std::vector of buffers that might be larger than requested.

I've adjusted the various implementations to handle this change -- most of them previously assumed and asserted that the count was the same.

In particular this meant moving some code around in the V4L2 implementations since they also do some internal allocations based on the number of picture buffers that actually end up being chosen.

BUG=485775

Review URL: https://codereview.chromium.org/1207043002

Cr-Commit-Position: refs/heads/master@{#344391}
2015-08-20 01:07:22 +00:00
nick
e478443485 Update {virtual,override} to follow C++11 style in ppapi.
The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override.

This patch was manually generated using a regex and a text editor.

BUG=417463

Review URL: https://codereview.chromium.org/1097393007

Cr-Commit-Position: refs/heads/master@{#326505}
2015-04-23 14:02:23 +00:00
Bill Budge
2d4bf3a9f7 Pepper: Expose visible_rect to PPB_VideoDecoder.GetPicture.
Adds an out parameter to GetPicture to return the subrectangle of
the picture texture that contains the picture.
Adds a new 0.3 version of PPB_VideoDecoder.

BUG=429071
NOPRESUBMIT=true
R=binji@chromium.org, dmichael@chromium.org, mpearson@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/703753002

Cr-Commit-Position: refs/heads/master@{#303102}
2014-11-06 22:33:05 +00:00
mostynb
699af3cc7b replace OVERRIDE and FINAL with override and final in ppapi/
R=dmichael@chromium.org,dcheng@chromium.org
BUG=417463

Review URL: https://codereview.chromium.org/630883002

Cr-Commit-Position: refs/heads/master@{#298269}
2014-10-06 18:03:57 +00:00
bbudge
4d6acafdc7 Pepper: PPB_VideoDecoder software-only mode.
Add 'Initialize' method that takes an enum value to specify hardware
acceleration policy. Policies are always, with fallback and only software.

BUG=406194

Review URL: https://codereview.chromium.org/496203002

Cr-Commit-Position: refs/heads/master@{#291606}
2014-08-23 22:18:36 +00:00
schenney@chromium.org
0ff052deca Revert of Revert of Implement software fallback for PPB_VideoDecoder. (https://codereview.chromium.org/337683002/)
Reason for revert:
Revert of revert, which apparently wasn't a full revert.

Original issue's description:
> Revert of Implement software fallback for PPB_VideoDecoder. (https://codereview.chromium.org/311853005/)
> 
> Reason for revert:
> Broke blink Linux tests compile.http://build.chromium.org/p/chromium.webkit/builders/Linux%20Tests/builds/37259
> 
> Original issue's description:
> > Implement software fallback for PPB_VideoDecoder.
> > This modifies the proxy to implement software fallback mode.
> > The main change is to the host, which now can work with
> > media::VideoDecoders.
> > 
> > media::VideoDecoder works differently from media::VideoDecodeAccelerator
> > so an adapter object, content::VideoDecoderShim is defined. It lives on the main thread and drives the actual decoder on the media thread via a child DecoderImpl class, which sends back frames of video. VideoDecoderShim receives those and converts frames to GL textures.
> > 
> > gpu::Mailboxes are used so the host can create textures that are aliased
> > to the plugin's textures.
> > 
> > The test plugin has been changed to include bitstream data for VP8 in order to
> > test the software decoder. The data is in ppapi/examples/video_decode/testdata.h
> > alongside the H264 data. The file diff is too large for this site but is structured
> > something like this:
> > 
> > const unsigned char kData[] = {
> > #if defined USE_VP8_TESTDATA_INSTEAD_OF_H264
> > ...  lots of VP8 data
> > 
> > #else  // !USE_VP8_TESTDATA_INSTEAD_OF_H264
> > ...  lots of H264 data
> > 
> > #endif  // USE_VP8_TESTDATA_INSTEAD_OF_H264
> > };
> > 
> > 
> > There is a TODO to convert the example to load a file. I'm not sure how to go
> > about that but am willing to do the work if someone can point the way.
> > 
> > BUG=281689
> > R=dmichael@chromium.org, fischman@chromium.org, sievers@chromium.org, tsepez@chromium.org
> > 
> > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277012
> 
> TBR=dmichael@chromium.org,fischman@chromium.org,igorc@chromium.org,piman@chromium.org,sievers@chromium.org,tsepez@chromium.org,bbudge@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=281689
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277015

TBR=dmichael@chromium.org,fischman@chromium.org,igorc@chromium.org,piman@chromium.org,sievers@chromium.org,tsepez@chromium.org,bbudge@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=281689

Review URL: https://codereview.chromium.org/333903002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277020 0039d316-1c4b-4281-b951-d872f2087c98
2014-06-13 15:00:14 +00:00
schenney@chromium.org
8bb3e51628 Revert of Implement software fallback for PPB_VideoDecoder. (https://codereview.chromium.org/311853005/)
Reason for revert:
Broke blink Linux tests compile.http://build.chromium.org/p/chromium.webkit/builders/Linux%20Tests/builds/37259

Original issue's description:
> Implement software fallback for PPB_VideoDecoder.
> This modifies the proxy to implement software fallback mode.
> The main change is to the host, which now can work with
> media::VideoDecoders.
> 
> media::VideoDecoder works differently from media::VideoDecodeAccelerator
> so an adapter object, content::VideoDecoderShim is defined. It lives on the main thread and drives the actual decoder on the media thread via a child DecoderImpl class, which sends back frames of video. VideoDecoderShim receives those and converts frames to GL textures.
> 
> gpu::Mailboxes are used so the host can create textures that are aliased
> to the plugin's textures.
> 
> The test plugin has been changed to include bitstream data for VP8 in order to
> test the software decoder. The data is in ppapi/examples/video_decode/testdata.h
> alongside the H264 data. The file diff is too large for this site but is structured
> something like this:
> 
> const unsigned char kData[] = {
> #if defined USE_VP8_TESTDATA_INSTEAD_OF_H264
> ...  lots of VP8 data
> 
> #else  // !USE_VP8_TESTDATA_INSTEAD_OF_H264
> ...  lots of H264 data
> 
> #endif  // USE_VP8_TESTDATA_INSTEAD_OF_H264
> };
> 
> 
> There is a TODO to convert the example to load a file. I'm not sure how to go
> about that but am willing to do the work if someone can point the way.
> 
> BUG=281689
> R=dmichael@chromium.org, fischman@chromium.org, sievers@chromium.org, tsepez@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277012

TBR=dmichael@chromium.org,fischman@chromium.org,igorc@chromium.org,piman@chromium.org,sievers@chromium.org,tsepez@chromium.org,bbudge@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=281689

Review URL: https://codereview.chromium.org/337683002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277015 0039d316-1c4b-4281-b951-d872f2087c98
2014-06-13 14:35:15 +00:00
bbudge@chromium.org
e1ae7eb4b0 Implement software fallback for PPB_VideoDecoder.
This modifies the proxy to implement software fallback mode.
The main change is to the host, which now can work with
media::VideoDecoders.

media::VideoDecoder works differently from media::VideoDecodeAccelerator
so an adapter object, content::VideoDecoderShim is defined. It lives on the main thread and drives the actual decoder on the media thread via a child DecoderImpl class, which sends back frames of video. VideoDecoderShim receives those and converts frames to GL textures.

gpu::Mailboxes are used so the host can create textures that are aliased
to the plugin's textures.

The test plugin has been changed to include bitstream data for VP8 in order to
test the software decoder. The data is in ppapi/examples/video_decode/testdata.h
alongside the H264 data. The file diff is too large for this site but is structured
something like this:

const unsigned char kData[] = {
#if defined USE_VP8_TESTDATA_INSTEAD_OF_H264
...  lots of VP8 data

#else  // !USE_VP8_TESTDATA_INSTEAD_OF_H264
...  lots of H264 data

#endif  // USE_VP8_TESTDATA_INSTEAD_OF_H264
};

There is a TODO to convert the example to load a file. I'm not sure how to go
about that but am willing to do the work if someone can point the way.

BUG=281689
R=dmichael@chromium.org, fischman@chromium.org, sievers@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/311853005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277012 0039d316-1c4b-4281-b951-d872f2087c98
2014-06-13 13:43:11 +00:00
bbudge@chromium.org
dfb0d06f30 Implement Pepper PPB_VideoDecoder interface.
Adds resource and host, unit test for the resource, and an example plugin.
Implements only the hardware accelerated case. Software fallback will be
in a follow-on CL.

Adds two new PP_Error codes:
PP_ERROR_UNREADABLE_INPUT
PP_ERROR_PLATFORM_FAILED

BUG=281689
R=dmichael@chromium.org, fischman@chromium.org, jar@chromium.org, piman@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/270213004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273920 0039d316-1c4b-4281-b951-d872f2087c98
2014-05-30 22:45:56 +00:00