CASampledSP
Loading...
Searching...
No Matches
CAUtils.h
Go to the documentation of this file.
1/*
2 * =================================================
3 * Copyright 2011 tagtraum industries incorporated
4 * This file is part of CASampledSP.
5 *
6 * CASampledSP is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * CASampledSP is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with CASampledSP; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 * =================================================
20 *
21 * @author <a href="mailto:hs@tagtraum.com">Hendrik Schreiber</a>
22 */
23#include <math.h>
24#include <jni.h>
25#include <AudioToolbox/AudioToolbox.h>
26#include <CoreServices/CoreServices.h>
27
28
48{
49 JNIEnv * env;
50 jobject javaInstance;
51 AudioStreamBasicDescription srcFormat;
52 AudioStreamPacketDescription * pktDescs;
53 char * srcBuffer;
56 SInt64 pos;
57 SInt64 lastPos;
58 UInt32 frameOffset;
60 char * cookie;
61 UInt32 cookieSize;
62};
63
68{
69 AudioConverterRef acref;
70 jobject sourceStream;
72};
73
78{
79 AudioFileID afid;
80};
81
86{
87 AudioFileStreamID asid;
88};
89
90void throwUnsupportedAudioFileExceptionIfError(JNIEnv *, int, const char*);
91
92void throwIOExceptionIfError(JNIEnv *, int, const char*);
93
94void throwIllegalArgumentExceptionIfError(JNIEnv *, int, const char *);
95
96void throwFileNotFoundExceptionIfError(JNIEnv *, int, const char *);
97
101void ca_create_url_ref(JNIEnv *, jstring, CFURLRef&);
void ca_create_url_ref(JNIEnv *, jstring, CFURLRef &)
Returns true if an error occurred.
Definition CAUtils.cpp:101
void throwUnsupportedAudioFileExceptionIfError(JNIEnv *, int, const char *)
Throws an UnsupportedAudioFileException exception.
Definition CAUtils.cpp:39
void throwIOExceptionIfError(JNIEnv *, int, const char *)
Throws an IOException.
Definition CAUtils.cpp:56
void throwFileNotFoundExceptionIfError(JNIEnv *, int, const char *)
Throws an IllegalArgumentException.
Definition CAUtils.cpp:90
void throwIllegalArgumentExceptionIfError(JNIEnv *, int, const char *)
Throws an IllegalArgumentException.
Definition CAUtils.cpp:73
Central context representing the native peer to the Java CACodecInputStream object.
Definition CAUtils.h:68
jobject sourceStream
Source stream object (Java)
Definition CAUtils.h:70
AudioConverterRef acref
The used AudioConverter.
Definition CAUtils.h:69
CAAudioIO * sourceAudioIO
CAAudioIO of the stream that we want to convert.
Definition CAUtils.h:71
Central context representing the native peer to the Java CAURLInputStream object.
Definition CAUtils.h:78
AudioFileID afid
File id.
Definition CAUtils.h:79
Central context representing the native peer to the Java CANativePeerInputStream object.
Definition CAUtils.h:48
JNIEnv * env
JNI environment.
Definition CAUtils.h:49
char * cookie
Cookie.
Definition CAUtils.h:60
SInt64 lastPos
Last position (in packets)
Definition CAUtils.h:57
UInt32 numPacketsPerRead
Number of packets per read.
Definition CAUtils.h:55
jobject javaInstance
Calling java object.
Definition CAUtils.h:50
char * srcBuffer
Source buffer.
Definition CAUtils.h:53
UInt32 frameOffset
Frame offset (needed for seeking to the middles of a packet)
Definition CAUtils.h:58
UInt32 srcSizePerPacket
Source size per packet.
Definition CAUtils.h:59
AudioStreamBasicDescription srcFormat
Source format.
Definition CAUtils.h:51
UInt32 cookieSize
Cookie size.
Definition CAUtils.h:61
SInt64 pos
Current position (in packets)
Definition CAUtils.h:56
UInt32 srcBufferSize
Source buffer size.
Definition CAUtils.h:54
AudioStreamPacketDescription * pktDescs
Packet descriptions.
Definition CAUtils.h:52
Central context representing the native peer to the Java CAStreamInputStream object.
Definition CAUtils.h:86
AudioFileStreamID asid
Stream id.
Definition CAUtils.h:87