-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTRAIN_00819.eml
135 lines (100 loc) · 4.2 KB
/
TRAIN_00819.eml
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
NoneNonedecompression session and do whatever you want with the pixel buffers it =
gives you. Why do you think you can't?
I believe this is a newbie question related to the general use of the =
decompression session. Let me try to explain:=20
First I initialize my decompression session within the data proc =
callback function:
*******START***********
if (videoData->decompressionSession =3D=3D NULL) {
cout << "create decompression session: ";
ImageDescriptionHandle imageDesc =3D =
(ImageDescriptionHandle)NewHandle(0);
err =3D SGGetChannelSampleDescription(c, (Handle)imageDesc);
err =3D createDecompressionSession( imageDesc,=20
videoData->width, =
videoData->height,k32BGRAPixelFormat,=20
displayAndCompressFrame, videoData,=20
&videoData->decompressionSession);
if (err =3D=3D 0) cout << "SUCCESS" << endl; else cout << "FAILED" =
<< endl;
}
*******END***********
I do the same for a compression session:
*******START***********
if (videoData->compressionSession =3D=3D NULL) {
cout << "create compression session: ";
err =3D createCompressionSession(
videoData->width, videoData->height, =
videoData->codecType,=20
videoData->averageDataRate, =
videoData->timeScale,
useCompressedFrame, videoData,
&videoData->compressionSession );
if (err =3D=3D 0) cout << "SUCCESS" << endl; else cout << "FAILED" =
<< endl;
} =20
*******END***********
Furthermore, within the data proc callback I have the decompression =
call:
*******START***********
err =3D ICMDecompressionSessionDecodeFrame( =
videoData->decompressionSession,
(UInt8 *)p, len, NULL, &frameTime, videoData );
*******END***********
which finally allows me to access the pure pixelBuffer to be accessed in =
my "displayAndCompressFrame" function.
In my "displayAndCompressFrame"-function I display the pixels on a =
custom frame and compress the frame via:
*******START***********
err =3D ICMCompressionSessionEncodeFrame( videoData->compressionSession, =
pixelBuffer,
displayTime, displayDuration, =
validTimeFlags,
frameOptions, NULL, NULL );
*******END***********
This triggers my "useCompressedFrame"-function:
*******START***********
static OSStatus useCompressedFrame( void *encodedFrameOutputRefCon,
ICMCompressionSessionRef session,
OSStatus err,
ICMEncodedFrameRef encodedFrame,
void *reserved ){
int size =3D ICMEncodedFrameGetDataSize( encodedFrame );
//// WHAT NOW ???
return err;
}
******** END***************
in which I can send the encoded frame across a network but before I =
involve any network functionality I first want to test if the =
decompression works. However, here is the problem and I will start with =
a simple first question:=20
Can I feed the encoded frame to the same decompression session which =
decompresses my device data and displays it or do I need to create a =
second decompression session with the respective callback ? If I need to =
create another decompression session are there any special requirements =
I need to take care of - so far my first try also failed.
Thanks a lot in advance,
best
-- A l e x
>=20
>=20
> --
> Seth Willits
>=20
>=20
>=20
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> QuickTime-API mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> =
http://lists.apple.com/mailman/options/quicktime-api/alexander_carot%40gmx=
.net
>=20
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/mlsubscriber.tech%40csmining.org
This email sent to [email protected]