webm/bindings.git
2 weeks agoUpdate README.Android 02/69502/1 master
Frank Galligan [Sun, 6 Apr 2014 17:18:44 +0000 (10:18 -0700)]
Update README.Android

2 weeks agoFix some warnings 01/69501/1
Frank Galligan [Sun, 6 Apr 2014 17:15:07 +0000 (10:15 -0700)]
Fix some warnings

2 weeks agoFix README.Android 00/69500/1
Frank Galligan [Sun, 6 Apr 2014 17:05:11 +0000 (10:05 -0700)]
Fix README.Android

You would get an error if you tried to configure libvpx before
creating Android.mk and Applicaiton.mk.

2 months agoFix libwebm bindings. 18/68718/1
Frank Galligan [Mon, 10 Feb 2014 18:38:10 +0000 (10:38 -0800)]
Fix libwebm bindings.

Lbiwebm added support for Duration on Blocks. The was needed for
Opus.

Change-Id: I549671da1318d0060d018195e76c704d24b55719

10 months agoAdd two missing function in libvpx config. 74/58474/2
hkuang [Thu, 13 Jun 2013 00:53:29 +0000 (17:53 -0700)]
Add two missing function in libvpx config.
Also correct the copy and paste error in the encoder app.

Change-Id: I1f9b3f505541735ed8a9be368af0b6ebdad4839c

10 months agoAdd a new android application example. 48/57048/4
hkuang [Wed, 29 May 2013 22:16:11 +0000 (15:16 -0700)]
Add a new android application example.

The features of this example are:
1. Allow choosing video source from filesystem.
2. Allow choosing audio source from filesystem.
3. Allow configuring video encoder parameters.
4. Allow configuring audio encoder parameters.
5. Allow playing back the encoded WebM file.

Change-Id: I078bc950ed4185a1dce41b015a32f7c7e534f8c9

11 months agoChange Vorbis Encoder initialization to behave like libvpx. 50/51050/1
Frank Galligan [Mon, 13 May 2013 22:56:51 +0000 (15:56 -0700)]
Change Vorbis Encoder initialization to behave like libvpx.

- Must pass in channels, sampleRate, and bitsPerSample to
  VorbisEncConfig.
- Remove Init() from VorbisEncConfig.
- Must pass in VorbisEncConfig to VorbisEncoder().

Change-Id: I687c25fb920479ac5a434c50be116f881420e648

11 months agoAdd timebase units to VorbisEncoder. 98/50898/1
Frank Galligan [Fri, 10 May 2013 22:02:30 +0000 (15:02 -0700)]
Add timebase units to VorbisEncoder.

- Change ReadCompressedFrame to set the timestamp of the returned
  frame to timebase units.

Change-Id: I605671027e9b702bb2602637c1a96ce2790b1ae3

11 months agoMerge "Change encoder to return single Vorbis encoded packets."
Frank Galligan [Fri, 10 May 2013 19:36:54 +0000 (12:36 -0700)]
Merge "Change encoder to return single Vorbis encoded packets."

11 months agoChange encoder to return single Vorbis encoded packets. 58/50858/1
Frank Galligan [Fri, 10 May 2013 18:25:28 +0000 (11:25 -0700)]
Change encoder to return single Vorbis encoded packets.

Change-Id: Ifae7777cd86ddd1d4fc9e591df21979fa5829aed

11 months agoAdd ReadCompressedFrame to Vorbis wrapper. 57/50857/1
Frank Galligan [Fri, 10 May 2013 18:22:52 +0000 (11:22 -0700)]
Add ReadCompressedFrame to Vorbis wrapper.

- This function deprecates ReadCompressedAudio.

Change-Id: Ia843bf03457d84277da6898dcef6817b56bd19d5

11 months agoAdd AudioFrame class for vorbis encode. 46/50346/1
hkuang [Tue, 7 May 2013 19:30:37 +0000 (12:30 -0700)]
Add AudioFrame class for vorbis encode.

Change-Id: Ie0e3944cbd8f8495dbbb9fabaf211837ae9b7f79

11 months agoRemove Java Vorbis Encoder. 33/50333/1
Frank Galligan [Tue, 7 May 2013 18:22:24 +0000 (11:22 -0700)]
Remove Java Vorbis Encoder.

- The same functionality was added to the C version of the Vorbis
  Encoder.

Change-Id: I7c26352db583d99a2d7744cca89f5a7155e55138

11 months agoFix IVF Writer 30/50230/1
Frank Galligan [Mon, 6 May 2013 22:40:53 +0000 (15:40 -0700)]
Fix IVF Writer

- Change sz variable to public.

Change-Id: I613fcaa7deee0a489d7d5c7c1fa90b2bbc041811

11 months agoCreate examples folder. 46/50146/3
Frank Galligan [Mon, 6 May 2013 03:43:59 +0000 (23:43 -0400)]
Create examples folder.

- Split up BindingsSamples.java into discrete examples.

Change-Id: Ic233771cdd80fd4ca08c645b05e606db656beea6

11 months agoAdd Vorbis config class to the C Vorbis encoder. 41/50141/1
Frank Galligan [Sun, 5 May 2013 21:47:18 +0000 (17:47 -0400)]
Add Vorbis config class to the C Vorbis encoder.

- Change audioEncodeSample() to use Vorbis config.
- Add audioVideoEncodeSample(), which uses the C Vorbis encoder.
- Remove Get/Set functions from C Vorbis encoder that deal with
  config variables.

Change-Id: I125219ce70e900caabbea4a549c0e5c7fc963a30

11 months agoAdd serial version id to LibVpxException. 29/50129/2
Frank Galligan [Sun, 5 May 2013 03:36:13 +0000 (23:36 -0400)]
Add serial version id to LibVpxException.

- Fixes a warning in Eclipse.

Change-Id: Ic8c92a662e7977984b21718f03fbeb48a1a5b81c

11 months agoFix README.Android. 21/50121/1
Frank Galligan [Sun, 5 May 2013 00:31:19 +0000 (20:31 -0400)]
Fix README.Android.

Change-Id: I982739d3b62c7cab0a3158d0ced5cecfec61e562

11 months agoChange IVFReader code to remove dependency on Gingerbread. 20/50120/1
Frank Galligan [Sun, 5 May 2013 00:03:22 +0000 (20:03 -0400)]
Change IVFReader code to remove dependency on Gingerbread.

Change-Id: I4cc384947369a2920de8bc46c2589e37a4536f4a

11 months agoCreate com/google/utils directory. 19/50119/1
Frank Galligan [Sat, 4 May 2013 23:54:37 +0000 (19:54 -0400)]
Create com/google/utils directory.

- Move helper files to utils directory.

Change-Id: I0c2501ff8bbf94b3d28180ae95ce945bc2cffafb

11 months agoAdd load of libvpx.so to LibVpxCom.java 18/50118/1
Frank Galligan [Sat, 4 May 2013 23:05:30 +0000 (19:05 -0400)]
Add load of libvpx.so to LibVpxCom.java

Change-Id: Ia453d980e8308043fbecc0d60b27e8d51a141e4b

11 months agoFix BindingsSamples.java and README.Android 17/50117/1
Frank Galligan [Sat, 4 May 2013 22:45:45 +0000 (18:45 -0400)]
Fix BindingsSamples.java and README.Android

- Changed example to call convertByteEncodeFrame().
- Fixed some errors in the readme.

Change-Id: Iaecab822aeeefabb61140a4febe2ca7806ab81a7

11 months agoAdd YV12 color format for the encoder. 70/50070/3
hkuang [Fri, 3 May 2013 20:55:07 +0000 (13:55 -0700)]
Add YV12 color format for the encoder.

Change-Id: Ia054088ff5fb7227144ede92187d337143c0bcea

11 months agoAddress Johann's comments from add int array CL. 53/50053/1
Frank Galligan [Fri, 3 May 2013 18:50:36 +0000 (11:50 -0700)]
Address Johann's comments from add int array CL.

- CL https://gerrit.chromium.org/gerrit/#/c/50038/ was merged by
  mistake. This CL is to address comments from the first CL.

Change-Id: I6d2a33fd9e5b3a552a279200ec1599131187ceec

11 months agoAdd int array input to convert and encode. 38/50038/1
Frank Galligan [Fri, 3 May 2013 16:29:53 +0000 (09:29 -0700)]
Add int array input to convert and encode.

- Android Bitmap class only returns an int array.

Change-Id: I9faf40952e23e617e462fffd83ab2590fe85c331

11 months agoFix README.Android. 68/49968/1
Frank Galligan [Thu, 2 May 2013 23:16:18 +0000 (16:16 -0700)]
Fix README.Android.

Change-Id: I5cbbbbd60ea03aae43a5c3c659b8454c95241519

11 months agoLiberalize PCM size check of WavReader. 49/49949/1
Frank Galligan [Thu, 2 May 2013 21:47:24 +0000 (14:47 -0700)]
Liberalize PCM size check of WavReader.

Change-Id: I898ba9f3eff065ed719472eaf8791a2c04837f26

11 months agoAdd format conversion function to VpxEnc. 07/49607/6
Frank Galligan [Tue, 30 Apr 2013 18:05:02 +0000 (11:05 -0700)]
Add format conversion function to VpxEnc.

- Add dependency on libyuv to libvpxJNI.so on Android.
- Add function to convert from some of the libyuv supported
  formats and encode to VP8 through LibVpxEnc.
- Added README.Android.
- Added check if libyuv is built on non-Android platforms.
- Added libyuv instructions for non-Android platforms.

Change-Id: Id24eb2571e34c2404751ec6e46386b2521c37857

11 months agoAdd C++ VorbisEncoder wrapper. 45/49445/3
Frank Galligan [Sat, 27 Apr 2013 22:58:52 +0000 (18:58 -0400)]
Add C++ VorbisEncoder wrapper.

- Using the C++ VorbisEncoder wrapper is faster than the Java
  VorbisEncoder wrapper. A follow up CL will remove the Java
  encoder wrapper.
- Rename VorbisEncoder.java to VorbisEncoderWrapper.java.
- Modifed Android.mk to work from BINDINGS_DIR.

Change-Id: Id7fc9b8ee25b58986fb79edbe8246eb7beba9a0a

11 months agoMerge "Add samples to show use of bindings."
Frank Galligan [Fri, 26 Apr 2013 00:33:18 +0000 (17:33 -0700)]
Merge "Add samples to show use of bindings."

11 months agoMerge "Fix andoird build of vorbis encode."
Johann [Thu, 25 Apr 2013 16:57:43 +0000 (09:57 -0700)]
Merge "Fix andoird build of vorbis encode."

11 months agoAdd samples to show use of bindings. 86/49186/2
Frank Galligan [Thu, 25 Apr 2013 16:42:33 +0000 (09:42 -0700)]
Add samples to show use of bindings.

- Add class to read PCM wav files.
- Add muxing and demuxing WebM sample.
- Add video encode sample.
- Add audio encode sample.
- Add audio and video encode sample.

Change-Id: I60388ca839a6dc49bba6ac882239b7a5040a9981

11 months agoMerge "Add java libvorbis encoding wrapper."
Frank Galligan [Thu, 25 Apr 2013 16:09:20 +0000 (09:09 -0700)]
Merge "Add java libvorbis encoding wrapper."

11 months agoFix andoird build of vorbis encode. 79/49179/1
Frank Galligan [Thu, 25 Apr 2013 15:55:06 +0000 (08:55 -0700)]
Fix andoird build of vorbis encode.

- Add vorbisenc.cc to Android makefile.

Change-Id: Id832ce6e1a336cad2554801f4fdb222df09c50b4

11 months agoFix issues with Y4MReader. 78/49178/1
Frank Galligan [Thu, 25 Apr 2013 15:39:01 +0000 (08:39 -0700)]
Fix issues with Y4MReader.

- Add support for 420jpeg type.
- Remove dependency on Gingerbread.
- Fix crash if y4mformat is not of an i420 type.

Change-Id: Ib7de3a20e2e20b09678344331da9ea16ecaf8c63

12 months agoAdd java libvorbis encoding wrapper. 65/48765/3
Frank Galligan [Sun, 21 Apr 2013 03:31:02 +0000 (23:31 -0400)]
Add java libvorbis encoding wrapper.

Change-Id: Ieb929687760671f446deede4a1978f8fdde98f50

12 months agoAdd JNI vorbis encoding. 64/48764/2
Frank Galligan [Sun, 21 Apr 2013 03:17:16 +0000 (23:17 -0400)]
Add JNI vorbis encoding.

Change-Id: Id6a7b985394fd71ef4bf20334236cdb09fb215c8

12 months agoAdd function to return OggPacket bytes. 63/48763/2
Frank Galligan [Sun, 21 Apr 2013 03:04:12 +0000 (23:04 -0400)]
Add function to return OggPacket bytes.

Change-Id: I6781ae6cf551aa62470f7eac9179c4079f13da8f

12 months agoMerge "Change Android to build libvpx under <project>/jni."
Frank Galligan [Wed, 17 Apr 2013 18:12:24 +0000 (11:12 -0700)]
Merge "Change Android to build libvpx under <project>/jni."

12 months agoChange Android to build libvpx under <project>/jni. 74/48374/2
Frank Galligan [Wed, 17 Apr 2013 17:50:46 +0000 (10:50 -0700)]
Change Android to build libvpx under <project>/jni.

- Currently libvpx (tag v1.2.0) can only be built from
  <project>/jni.

Change-Id: I71b080b2fbd899fd84266e8b2a820328587cf2a3

12 months agoFix Android build. 69/48369/1
Frank Galligan [Wed, 17 Apr 2013 17:35:24 +0000 (10:35 -0700)]
Fix Android build.

- Change define to __ANDROID__.

Change-Id: I41475c98972cc382d59f5a8fa549795612fc6338

12 months agoAdd Android support. 11/48311/3
Frank Galligan [Tue, 16 Apr 2013 23:21:26 +0000 (16:21 -0700)]
Add Android support.

- Add Android.mk to build for Android.
- Change preprocessor to __ANDROID__
- Bug fix for env->SetLongField
- Set integer literal suffix
- Fix many int <-> long conversions.

Change-Id: I8d89dbc10261362331c393f35e971222fba03256

12 months agoRemoved the wrapper for IsOpen. 14/46914/1
Michael Szal [Fri, 29 Mar 2013 21:54:11 +0000 (14:54 -0700)]
Removed the wrapper for IsOpen.

IsOpen was removed from the underlying webm library.

Change-Id: I990e9643d8596457c163a7eaf784f476f7959d65

12 months agoFixed order of parameters in Makefile. 42/46642/1
Michael Szal [Mon, 25 Mar 2013 17:40:29 +0000 (10:40 -0700)]
Fixed order of parameters in Makefile.

Change-Id: Id6db6fe7fcfd777acce36b7c46245d45aa535eeb

14 months agoUpdated the WebM wrappers with new classes. 04/41904/1
Michael Szal [Wed, 16 Jan 2013 02:41:46 +0000 (18:41 -0800)]
Updated the WebM wrappers with new classes.

New classes have shown up in the original code, so I added
wrappers for those.  Also fixed a bunch of warnings (mostly
overrides and static functions).

Change-Id: I7bf2a4ef3c1e523c30cb12b6471f1a470691a5c2

14 months agoUpdated Vorbis wrappers. 69/41869/1
Michael Szal [Wed, 23 Jan 2013 22:11:59 +0000 (14:11 -0800)]
Updated Vorbis wrappers.

I gave the Vorbis wrappers more substance so they can be
used in a more Java-like way: there are classes with
getters and setters, and the classes can be passed to
functions.  Also re-named files to match the file and struct
names of the original code.

Change-Id: I1b554e38b8274527eba30328391bec85ef4f030e

14 months agoAdded wrappers for Ogg classes that are used by libvorbis. 05/41805/1
Michael Szal [Wed, 16 Jan 2013 02:41:46 +0000 (18:41 -0800)]
Added wrappers for Ogg classes that are used by libvorbis.

Change-Id: I1e91bd3d1f6a30e84ebc1d58f6b864e05873ffcd

17 months agoFinished the SampleMultiplexer app. 21/38421/3
Michael Szal [Thu, 15 Nov 2012 01:25:11 +0000 (17:25 -0800)]
Finished the SampleMultiplexer app.

The sample reads and decodes a WebM file, then re-encodes and
writes it to a seperate WebM output file.  Not very exciting, but
it shows how to use the libraries.

It turns out JNI does not like underscores in function names
because it uses underscores in class path names.  (Example:
com.google.libwebm.mkvmuxer.Cluster.blocks_added gets converted
to com_google_libwebm_mkvmuxer_Cluster_blocks_added, so it tries
to find a function called added in the blocks class.)  I re-named
functions with underscores to camel-case style.

Also re-organised the Makefile and corrected dependencies.  Moved
all Java class output files to their own class/ tree, so "make
clean" can delete them all.  (Previously it was not deleting
inner-class files like Segment$Mode.class.)

Fixed null-pointer error in getClassType.

Change-Id: Idf67d66143af55a7cd1d5324fdddab0d29c3d578

17 months agoAdded bindings for libwebm classes in the mkvmuxer namespace. 59/37759/1
Michael Szal [Tue, 6 Nov 2012 01:59:56 +0000 (17:59 -0800)]
Added bindings for libwebm classes in the mkvmuxer namespace.

Fixed some bugs in the mkvparser code.

Change-Id: Ie2482096dbb510f4e3c50d3618341d8f475c8bea

17 months agoAdded JNI bindings for libwebm classes in the mkvparser 25/36725/1
Michael Szal [Sat, 8 Sep 2012 01:12:41 +0000 (18:12 -0700)]
Added JNI bindings for libwebm classes in the mkvparser
namespace.

I also started a sample multiplexer app to mirror the C++ one,
but I have to add the rest of the functions to finish it.

Change-Id: I7505f64d9251f590e8235c07e6249131b8ce46e9

19 months agoMoved libvpx_*.cc files into the vpx directory. 15/32415/3
Michael Szal [Wed, 5 Sep 2012 22:38:12 +0000 (15:38 -0700)]
Moved libvpx_*.cc files into the vpx directory.

Added libvorbis_*.cc files in the vorbis directory.  Some
functions had to be changed slightly because Java arrays work
differently than C++ arrays.  See the comments in the
LibVorbisEncode/Decode.java files.

Added constants for the various error conditions.

Removed dependency on the special x64 directory in the Makefile.
It works if you install libvpx normally.  For some reason it
doesn't know to check /usr/local/lib for shared libraries, so I
had to set LD_LIBRARY_PATH in the Makefile.

Updated the README to reflect the new project setup.

I discovered a memory leak in the libvpx.cc files.  You must call
Release regardless of the value of isCopy.  isCopy is only there
for you to check if you can safely modify the object you get
back.

Change-Id: Ic41eb07f38ffc979654496760b31e617c7d1787a

20 months agouse java/javac from $(JAVA_HOME) 10/28410/2
James Zern [Wed, 25 Jul 2012 18:23:24 +0000 (11:23 -0700)]
use java/javac from $(JAVA_HOME)

fixes an issue with make run where the java interpreter in PATH is a
different architecture from the JNI library:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
libvpxJNI.so: libvpxJNI.so: wrong
ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1755)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1680)
        at java.lang.Runtime.loadLibrary0(Runtime.java:840)
        at java.lang.System.loadLibrary(System.java:1047)
        at com.google.libvpx.LibVpxCom.<clinit>(LibVpxCom.java:11)
        at Application.main(Application.java:48)
make: *** [run] Error 1

Change-Id: I04ef6eda9eb8fa34646d8e665d659385f201d774

20 months agoAdd missing path dependency. 03/28403/1
Fritz Koenig [Wed, 25 Jul 2012 17:31:51 +0000 (10:31 -0700)]
Add missing path dependency.

vpx_config.h is in x64 directory.

Change-Id: I0c6ad96c6881d7de7353454376d654734d7a4901

2 years agoUse true == success for boolean functions 12/16112/1
Fritz Koenig [Fri, 17 Feb 2012 02:27:41 +0000 (18:27 -0800)]
Use true == success for boolean functions

Change-Id: I1a2252f28e39fc7ca5020000441f25298966c943

2 years agoHandle vpxCodecDecInit error. 02/16102/5
Fritz Koenig [Fri, 17 Feb 2012 01:00:16 +0000 (17:00 -0800)]
Handle vpxCodecDecInit error.

Throw error if configuration is invalid.

Set config structures to 0.

Change-Id: I6355189c21418c0c7ee9a0bcb6132bf346d1c5fb

2 years agoWrap input frame with vpx_img_wrap. 88/16088/2
Fritz Koenig [Thu, 16 Feb 2012 23:17:39 +0000 (15:17 -0800)]
Wrap input frame with vpx_img_wrap.

Avoid allocating memory and copying
the input frame into it line by line.

Change-Id: I03435c61b6583c5be235ddcd8b5a7a962a421e71

2 years agoCleanup README. 89/15989/1
Fritz Koenig [Thu, 16 Feb 2012 00:40:38 +0000 (16:40 -0800)]
Cleanup README.

Better directions to get started with
the sample application and building
the libvpx lib for jni.

Change-Id: I160ac0a7673bfd37da3432ceb9b7619ee21e257d

2 years agoChange libvpx from static to shared. 22/15922/3
Fritz Koenig [Wed, 15 Feb 2012 19:11:02 +0000 (11:11 -0800)]
Change libvpx from static to shared.

Moving to shared libvpx allows for
building the optimized assembly code
with pic.

Change-Id: Ie8f9529017f6c7874f84a432e61b91eceb97a73a

2 years agoInitialize all of ebml struct to 0. 16/15916/2
Fritz Koenig [Wed, 15 Feb 2012 18:29:53 +0000 (10:29 -0800)]
Initialize all of ebml struct to 0.

Control logic is based on structure
being 0.

Change-Id: Ic469a6e80039103ec279ab693774021ee566b214

2 years agoReturn decoded frame and send to file. 30/15830/7
Fritz Koenig [Tue, 14 Feb 2012 19:56:32 +0000 (11:56 -0800)]
Return decoded frame and send to file.

Implement y4m writing class as a way
of saving the uncompressed video.

Change-Id: Iae6a293e7a63be81d31bea74131bc5b2f0b7461f

2 years agoAdd WebM muxer. 24/15824/2
Fritz Koenig [Tue, 14 Feb 2012 18:50:51 +0000 (10:50 -0800)]
Add WebM muxer.

Brought in libvpx WebM muxer.  Not very Java
like, does file i/o through JNI.

Change-Id: Ib9202fadddc128c7b8733c6430a5044178d6ad0c

2 years agoRework frame start and end calculations. 91/15791/3
Fritz Koenig [Mon, 13 Feb 2012 23:32:24 +0000 (15:32 -0800)]
Rework frame start and end calculations.

Correctly pull the timebase from the codec
configuration and use that for start and
end time computation.

Modify Rational class to handle more math.

Change-Id: Ieb00ac14b41ac2c4eb606bb09f54b84c9fb7c655

2 years agoJNI bindings for libvpx. 43/15343/8
Fritz Koenig [Mon, 6 Feb 2012 20:09:25 +0000 (12:09 -0800)]
JNI bindings for libvpx.

These bindings produce a interface between
the native libvpx code and Java.  The code
tries to match the native libvpx interface
as much as possible.

Basic 1 pass encoding works.  These bindings
are aimed at 1 pass and real time encoding.

Basic decoding works.

Change-Id: I57bc9d8ad75af7501261fe7d5bb4cdf6f5a76129