-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSoyJava.h
executable file
·628 lines (495 loc) · 20.5 KB
/
SoyJava.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
#pragma once
#include <SoyAssert.h>
#include <SoyTime.h>
//#include <SoyOpengl.h>
#include <jni.h>
#include <sstream>
#include <SoyStream.h>
class TJniObject;
class JSurfaceTexture;
class JSurface;
class TJniString;
class TJniClass;
template<typename TYPE>
class TJniLocalObject;
namespace Opengl
{
class TTexture;
}
#define INVALID_FILE_HANDLE 0 // gr: I swear this is declared somewhere in soy
// media format keys
// android java defines, see if we can find a JNI header with these
#define KEY_WIDTH "width"
#define KEY_HEIGHT "height"
#define KEY_DURATION "durationUs"
#define KEY_COLOR_FORMAT "color-format"
#define KEY_FRAME_RATE "frame-rate"
#define KEY_MIME "mime"
#define KEY_PROFILE "profile"
#define KEY_CHANNEL_COUNT "channel-count"
#define KEY_SAMPLE_RATE "sample-rate"
#define KEY_BITS_FORMAT_UNDOCUMENTED "bits-format"
namespace Soy
{
std::string JStringToString(jstring Stringj);
std::string JStringToString(TJniLocalObject<jstring>& Stringj);
}
namespace Java
{
bool HasVm();
JNIEnv& GetContext();
void FlushLocals(); // wrapper to flush current thread's locals
size_t GetBufferSize(TJniObject& Buffer);
void ArrayToBuffer(const ArrayBridge<uint8>&& Data,TJniObject& InputBuffer,const std::string& Context,int ExplicitBufferSize=-1);
void BufferToArray(TJniObject& InputBuffer,ArrayBridge<uint8>&& Data,const std::string& Context,int ExplicitBufferSize=-1);
FixedRemoteArray<uint8> GetBufferArray(TJniObject& Buffer,int LimitSize=-1); // get buffer as array. throws if this option isn't availible for this buffer
void IsOkay(const std::string& Context,bool ThrowRegardless=false); // check for JNI exception
std::string GetBundleIdentifier();
class TFileHandle;
class TApkFileHandle; // special access to files in Assets which need to be loaded in a special way
class TZipFileHandle; // expecting a filename like file://file.obb!/internalfilename.txt
class TRandomAccessFileHandle;
class TFileHandleStreamReader; // special file reader that uses JNI to read from APK
typedef ::TFileStreamReader_ProtocolLambda<TFileHandleStreamReader> TApkFileStreamReader_ProtocolLambda;
std::shared_ptr<TFileHandle> AllocFileHandle(const std::string& Filename);
// according to android docs
// http://developer.android.com/training/articles/perf-jni.html
// JNI won't auto-free locals in a thread until it detatches (gr: not sure HOW it EVER cleans up then...)
// so instead, we'll manually push&pop frames of locals.
// hopefully this may show up cases where we need global refs, but more importantly we won't overflow the local stack (happens with long movies & ones with audio which use up locals much faster)
// gr: look for a way to auto count locals... not found one yet
class TLocalRefStack;
class TThread; // java thread handler, handles env creation & destruction and local object stack
}
namespace Platform
{
std::string GetSdCardDirectory(); // throws if we can't get it
}
class Java::TLocalRefStack
{
public:
TLocalRefStack(size_t MaxLocals=100);
~TLocalRefStack();
};
class Java::TThread
{
public:
TThread(JavaVM& vm);
~TThread();
void Init() { FlushLocals(); }
void FlushLocals();
public:
JavaVM& mVirtualMachine;
JNIEnv* mThreadEnv;
std::shared_ptr<TLocalRefStack> mLocalStack; // ptr so we can destruct & recreate it to flush all local vars
};
class Java::TFileHandle
{
protected:
static const int UNKNOWN_LENGTH = -1;
public:
TFileHandle();
~TFileHandle();
ssize_t Seek(); // returns bytes remaining, negative if unknown
void Read(ArrayBridge<uint8>&& Buffer,bool& Eof);
protected:
virtual int GetInitialSeekPos() const { return 0; }
virtual int GetLength() const { return UNKNOWN_LENGTH; } // -1 if unknown
public:
int mFd;
std::shared_ptr<TJniObject> mFileDescriptor;
protected:
bool mDoneInitialSeek;
};
class Java::TApkFileHandle : public Java::TFileHandle
{
public:
TApkFileHandle(const std::string& Path);
~TApkFileHandle();
virtual int GetInitialSeekPos() const override { return mFdOffset; }
virtual int GetLength() const override { return mFdLength; } // -1 if unknown
protected:
int mFdOffset;
int mFdLength;
std::shared_ptr<TJniObject> mAssetFileDescriptor;
};
class Java::TZipFileHandle : public Java::TFileHandle
{
public:
TZipFileHandle(const std::string& Path);
~TZipFileHandle();
virtual int GetInitialSeekPos() const override { return mFdOffset; }
virtual int GetLength() const override { return mFdLength; } // -1 if unknown
protected:
int mFdOffset;
int mFdLength;
std::shared_ptr<TJniObject> mAssetFileDescriptor;
};
class Java::TRandomAccessFileHandle : public Java::TFileHandle
{
public:
TRandomAccessFileHandle(const std::string& Path);
~TRandomAccessFileHandle();
std::shared_ptr<TJniObject> mRandomAccessFile;
};
class Java::TFileHandleStreamReader : public TStreamReader
{
public:
TFileHandleStreamReader(const std::string& Filename,std::shared_ptr<TStreamBuffer> ReadBuffer=nullptr);
~TFileHandleStreamReader();
protected:
virtual bool Read(TStreamBuffer& Buffer) override;
virtual void Shutdown() __noexcept override;
private:
std::shared_ptr<Java::TFileHandle> mHandle;
};
// gr: work out signatures from javap
// http://answers.unity3d.com/questions/857726/can-i-get-a-list-of-methods-for-a-class-with-jni.html#answer-984776
// cd $ANDROID_HOME/platforms/android-19
// javap -classpath android.jar -s android.media.MediaPlayer
template<typename TYPE>
inline std::string GetSignatureType(const TYPE& t)
{
std::stringstream Signature;
Soy::Assert( t.GetClassName().find('.') == std::string::npos, t.GetClassName() + "dots in class name when being used in signature. needs to be normalised" );
Signature << 'L' << t.GetClassName() << ';';
return Signature.str();
}
template<typename TYPE> inline std::string GetSignatureType()
{
// throw?
return "NULL";
}
template<> inline std::string GetSignatureType<int>() { return "I"; }
template<> inline std::string GetSignatureType<bool>() { return "Z"; }
template<> inline std::string GetSignatureType<jlong>() { return "J"; }
//template<> inline std::string GetSignatureType<long>() { return "J"; } // gr: in androidndk r18 this was a different type. in r23 it's same as long
template<> inline std::string GetSignatureType<void>() { return "V"; }
template<> inline std::string GetSignatureType<float>() { return "F"; }
template<> inline std::string GetSignatureType<jbyte>() { return "B"; }
template<> inline std::string GetSignatureType<uint8>() { return "B"; }
template<> inline std::string GetSignatureType<jstring>() { return "Ljava/lang/String;"; }
template<> inline std::string GetSignatureType<std::string>() { return "Ljava/lang/String;"; }
template<> inline std::string GetSignatureType<TJniString>() { return "Ljava/lang/String;"; }
class TJniString : public NonCopyable
{
public:
TJniString(const std::string& String);
~TJniString();
std::string Get() const;
public:
jstring mString;
std::string mCache; // for debugging
};
class TJniParam
{
public:
virtual const char* GetSignature() const=0;
};
template<typename TYPE>
class TJniParam_TYPE : public TJniParam
{
public:
TJniParam_TYPE(const TYPE& Value) :
mValue ( Value )
{
}
TYPE mValue;
};
class TJniParam_object : public TJniParam_TYPE<jobject>
{
public:
TJniParam_object(const char* Type,jobject Object) :
mType ( Type ),
TJniParam_TYPE ( Object )
{
}
virtual const char* GetSignature() const override { return mType; }
const char* mType;
};
class TJniParam_int : public TJniParam_TYPE<int>
{
public:
TJniParam_int(int Value) :
TJniParam_TYPE ( Value )
{
}
virtual const char* GetSignature() const override { return "I"; }
};
/*
class TJniParam_string : public TJniParam_TYPE<jstring>
{
public:
TJniParam_string(const std::string& Value) :
TJniParam_TYPE ( Soy::StringToJString(Value) )
{
}
virtual const char* GetSignature() const override { return "Landroid/string;"; }
};
*/
template<typename RETURNTYPE>
inline std::string GetSignature()
{
std::stringstream ss;
ss << "()" << GetSignatureType<RETURNTYPE>();
return ss.str();
}
template<typename RETURNTYPE>
inline std::string GetSignature(const std::string& SigTypea)
{
std::stringstream ss;
ss << "(" << SigTypea << ")" << GetSignatureType<RETURNTYPE>();
return ss.str();
}
template<typename RETURNTYPE>
inline std::string GetSignature(const std::string& SigTypea,const std::string& SigTypeb)
{
std::stringstream ss;
ss << "(" << SigTypea << SigTypeb << ")" << GetSignatureType<RETURNTYPE>();
return ss.str();
}
template<typename RETURNTYPE>
inline std::string GetSignature(const std::string& SigTypea,const std::string& SigTypeb,const std::string& SigTypec)
{
std::stringstream ss;
ss << "(" << SigTypea << SigTypeb << SigTypec << ")" << GetSignatureType<RETURNTYPE>();
return ss.str();
}
template<typename RETURNTYPE>
inline std::string GetSignature(const std::string& SigTypea,const std::string& SigTypeb,const std::string& SigTypec,const std::string& SigTyped)
{
std::stringstream ss;
ss << "(" << SigTypea << SigTypeb << SigTypec << SigTyped << ")" << GetSignatureType<RETURNTYPE>();
return ss.str();
}
template<typename RETURNTYPE>
inline std::string GetSignature(const std::string& SigTypea,const std::string& SigTypeb,const std::string& SigTypec,const std::string& SigTyped,const std::string& SigTypee)
{
std::stringstream ss;
ss << "(" << SigTypea << SigTypeb << SigTypec << SigTyped << SigTypee << ")" << GetSignatureType<RETURNTYPE>();
return ss.str();
}
// merge this into TJniObject
// gr: use this to explicitly flush variables (eg. loops). For general clear up, use Java::TThread::FlushLocals()
template<typename TYPE>
class TJniLocalObject
{
public:
// construct with jobject to reduce neccessary casts in caller, and all objects should be derived from jobject anyway
TJniLocalObject(jobject Object,bool ReleaseRef=true) :
mObject ( static_cast<TYPE>(Object) ),
mRelease ( ReleaseRef )
{
}
~TJniLocalObject()
{
if ( mObject && mRelease )
{
auto& Context = Java::GetContext();
Context.DeleteLocalRef( mObject );
Java::IsOkay( "DeleteLocalRef" );
}
}
operator bool() const { return mObject != nullptr; }
TJniClass GetClass();
public:
TYPE mObject;
bool mRelease;
};
class TJniClass
{
public:
TJniClass(const char* ClassName);
TJniClass(const jclass& Class,const char* ClassName);
TJniClass(const TJniClass& Class);
~TJniClass() { Release(); }
operator bool() const { return mClass != nullptr; }
TJniClass& operator=(const TJniClass& that);
const std::string& GetClassName() const { return mClassName; }
static void NormaliseClassName(std::string& ClassName);
template<typename RETURNTYPE> jmethodID GetMethod(const std::string& MethodName) { auto Signature = GetSignature<RETURNTYPE>(); return GetMethod( MethodName, Signature ); }
template<typename RETURNTYPE> jmethodID GetMethod(const std::string& MethodName,const std::string& SigTypea) { auto Signature = GetSignature<RETURNTYPE>(SigTypea); return GetMethod( MethodName, Signature ); }
template<typename RETURNTYPE> jmethodID GetMethod(const std::string& MethodName,const std::string& SigTypea,const std::string& SigTypeb) { auto Signature = GetSignature<RETURNTYPE>(SigTypea,SigTypeb); return GetMethod( MethodName, Signature ); }
template<typename RETURNTYPE> jmethodID GetMethod(const std::string& MethodName,const std::string& SigTypea,const std::string& SigTypeb,const std::string& SigTypec) { auto Signature = GetSignature<RETURNTYPE>(SigTypea,SigTypeb,SigTypec); return GetMethod( MethodName, Signature ); }
template<typename RETURNTYPE> jmethodID GetMethod(const std::string& MethodName,const std::string& SigTypea,const std::string& SigTypeb,const std::string& SigTypec,const std::string& SigTyped) { auto Signature = GetSignature<RETURNTYPE>(SigTypea,SigTypeb,SigTypec,SigTyped); return GetMethod( MethodName, Signature ); }
template<typename RETURNTYPE> jmethodID GetMethod(const std::string& MethodName,const std::string& SigTypea,const std::string& SigTypeb,const std::string& SigTypec,const std::string& SigTyped,const std::string& SigTypee) { auto Signature = GetSignature<RETURNTYPE>(SigTypea,SigTypeb,SigTypec,SigTyped,SigTypee); return GetMethod( MethodName, Signature ); }
jmethodID GetMethod(const std::string& MethodName,const std::string& Signature);
jmethodID GetStaticMethod(const std::string& MethodName,const std::string& Signature);
TJniObject GetStaticFieldObject(const std::string& FieldName,const std::string& ClassName);
TJniObject CallStaticObjectMethod(const std::string& MethodName,const std::string& ReturnClass,const std::string& ParamA);
TJniObject CallStaticObjectMethod(const std::string& MethodName,const std::string& ReturnClass,const std::string& ParamA,const int& ParamB,const int& ParamC);
TJniObject CallStaticObjectMethod(const std::string& MethodName,const std::string& ReturnClass,int ParamA);
jclass GetWeakClass() { return mClass; }
void Release();
protected:
std::string mClassName;
jclass mClass;
bool mAutoReleaseClass;
};
template<typename TYPE>
TJniClass TJniLocalObject<TYPE>::GetClass()
{
auto& Context = Java::GetContext();
return TJniClass( Context.GetObjectClass( mObject ), nullptr );
}
class TJniObject : public TJniClass
{
private:
TJniObject(const TJniClass& Class) :
mObject ( nullptr ),
mAutoReleaseObject ( false ),
TJniClass ( Class )
{
}
public:
TJniObject(jobject Object,jclass Class,const char* ClassName);
TJniObject(const char* ClassName);
// TJniObject(const char* ClassName,const TJniParam& ParamA);
// sort these out so we don't have a thousand combos
explicit TJniObject(const char* ClassName,const int& ParamA);
explicit TJniObject(const char* ClassName,const int& ParamA,const bool& ParamB);
explicit TJniObject(const char* ClassName,const std::string& ParamA);
explicit TJniObject(const char* ClassName,const std::string& ParamA,const std::string& ParamB);
explicit TJniObject(const char* ClassName,TJniObject& ParamA);
TJniObject(const TJniObject& that);
~TJniObject() { Release(); }
// gr: RAII implementation says no null objects... but sometimes for JNI we want to pass null. bit of a special case
// require class here?
static TJniObject Null(const std::string& ClassName) { return TJniObject( TJniClass(ClassName.c_str()) ); }
operator bool() const { return mObject != nullptr; }
TJniObject& operator=(const TJniObject& that);
jobject GetWeakObject() const { return mObject; }
// gr: only used as params to java funcs, should we get rid of this?
jobject GetStrongObject();
void Release();
bool IsStrongObjectReference() const { return mObject && mAutoReleaseObject; }
// super simple cases - these throw on error
void CallVoidMethod(const std::string& MethodName);
void CallVoidMethod(const std::string& MethodName,const int& ParamA);
void CallVoidMethod(const std::string& MethodName,const long& ParamA);
void CallVoidMethod(const std::string& MethodName,int ParamA,bool ParamB);
void CallVoidMethod(const std::string& MethodName,TJniObject& ParamA);
void CallVoidMethod(const std::string& MethodName,TJniObject& ParamA,TJniObject& ParamB,TJniObject& ParamC,int ParamD);
void CallVoidMethod(const std::string& MethodName,int ParamA,int ParamB,int ParamC,long ParamD,int ParamE);
void CallVoidMethod(const std::string& MethodName,const std::string& ParamA);
void CallVoidMethod(const std::string& MethodName,const std::string& ParamA,const int& ParamB);
void CallVoidMethod(const std::string& MethodName,const std::string& ParamA,const long& ParamB);
void CallVoidMethod(const std::string& MethodName,const std::string& ParamA,TJniObject& ParamB);
bool CallBoolMethod(const std::string& MethodName);
uint8 CallByteMethod(const std::string& MethodName,const int& ParamA);
int CallIntMethod(const std::string& MethodName);
int CallIntMethod(const std::string& MethodName,const std::string& ParamA);
int CallIntMethod(const std::string& MethodName,const int& ParamA);
int CallIntMethod(const std::string& MethodName,const long& ParamA);
int CallIntMethod(const std::string& MethodName,TJniObject& ParamA,const int& ParamB);
int CallIntMethod(const std::string& MethodName,TJniObject& ParamA,const long& ParamB);
float CallFloatMethod(const std::string& MethodName,const std::string& ParamA);
jlong CallLongMethod(const std::string& MethodName);
jlong CallLongMethod(const std::string& MethodName,const std::string& ParamA);
std::string CallStringMethod(const std::string& MethodName);
std::string CallStringMethod(const std::string& MethodName,const std::string& ParamA);
TJniObject CallObjectMethod(const std::string& MethodName,const std::string& ReturnClass);
TJniObject CallObjectMethod(const std::string& MethodName,const std::string& ReturnClass,const jstring& ParamA); // specific case atm
TJniObject CallObjectMethod(const std::string& MethodName,const std::string& ReturnClass,const std::string& ParamA); // specific case atm
TJniObject CallObjectMethod(const std::string& MethodName,const std::string& ReturnClass,const int& ParamA); // specific case atm
TJniObject CallObjectMethod(const std::string& MethodName,const std::string& ReturnClass,const uint8& ParamA);
int GetIntField(const std::string& Name);
int GetLongField(const std::string& Name);
void SetCallback(const std::string& SetListenerMethodName,std::function<void(void)> Callback);
private:
void Alloc(std::function<jobject()> Constructor);
void PreFunctionCall(const char* Func,const std::string& MethodName,...);
private:
jobject mObject;
bool mAutoReleaseObject;
};
std::ostream& operator<<(std::ostream &out,const TJniObject& in);
class JniMediaPlayer : public TJniObject
{
public:
JniMediaPlayer() :
TJniObject ( "android/media/MediaPlayer" )
{
}
void Prepare() { CallVoidMethod("prepare"); }
void Start() { CallVoidMethod("start"); }
void Stop() { CallVoidMethod("stop"); }
void Seek(SoyTime Time);
void SetLooping(bool Looping);
void SetTrack(int TrackIndex);
bool IsPlaying() { return CallBoolMethod("isPlaying"); }
int GetCurrentTime() { return CallIntMethod("getCurrentPosition"); }
int GetDuration() { return CallIntMethod("getDuration"); }
int GetWidth() { return CallIntMethod("getVideoWidth"); }
int GetHeight() { return CallIntMethod("getVideoHeight"); }
void SetDataSourceAssets(const std::string& Path);
void SetDataSourceSdCard(const std::string& Path);
void SetDataSourcePath(const std::string& Path);
void SetSurface(JSurface& Surface);
void GetState(std::ostream& Stream);
};
class JSurfaceTexture : public TJniObject
{
public:
JSurfaceTexture(const Opengl::TTexture& Texture);
JSurfaceTexture(const Opengl::TTexture& Texture,bool SingleBufferMode);
bool UpdateTexture();
jlong GetTimestampNano();
bool SetBufferSize(size_t Width,size_t Height);
public:
jmethodID mMethodUpdateTexImage;
jmethodID mMethodGetTimestamp;
jmethodID mMethodSetDefaultBufferSize;
};
class JSurface : public TJniObject
{
public:
JSurface(JSurfaceTexture& SurfaceTexture) :
TJniObject ( "android/view/Surface", SurfaceTexture )
{
}
public:
};
class JniMediaFormat : public TJniObject
{
public:
JniMediaFormat(const TJniObject& Object) :
TJniObject ( Object )
{
Soy::Assert( GetWeakObject()!=nullptr, "JniMediaFormat expected object" );
}
int GetWidth() { return CallIntMethod("getInteger", KEY_WIDTH ); }
int GetHeight() { return CallIntMethod("getInteger", KEY_HEIGHT ); }
int GetSampleRate() { return CallIntMethod("getInteger", KEY_SAMPLE_RATE ); }
void SetSampleRate(int Value) { CallVoidMethod("setInteger", KEY_SAMPLE_RATE, Value ); }
int GetChannelCount() { return CallIntMethod("getInteger", KEY_CHANNEL_COUNT ); }
void SetChannelCount(int Value) { CallVoidMethod("setInteger", KEY_CHANNEL_COUNT, Value ); }
};
class JniMediaExtractor : public TJniObject
{
public:
JniMediaExtractor() :
TJniObject ( "android/media/MediaExtractor" )
{
}
// gr: change this to a file handle factory and let SetDataSource run off that
void SetDataSourceAssets(const std::string& Path);
void SetDataSourceJar(const std::string& Path);
void SetDataSourceSdCard(const std::string& Path);
void SetDataSourcePath(const std::string& Path);
void SetDataSourceAssetFileDescriptor(TJniObject& AssetFileDescriptor,bool CloseOnFinish=true);
int GetTrackCount() { return TJniObject::CallIntMethod("getTrackCount"); }
JniMediaFormat GetTrack(int TrackIndex)
{
auto Object = CallObjectMethod("getTrackFormat","android/media/MediaFormat", TrackIndex );
return JniMediaFormat(Object);
}
};
// gr: where was this needed?
/*
template<>
inline std::string GetSignatureType(const TJniClass& t)
{
return t.GetClassName().c_str();
}
*/