2 * Copyright (C) 2011 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef _SERVER_CONNECTION_H
17 #define _SERVER_CONNECTION_H
19 #include "GLEncoder.h"
20 #include "GL2Encoder.h"
22 #include "codec_defs.h"
23 #include "ut_rendercontrol_enc.h"
26 #define ENV_RGL_SERVER "RGL_SERVER"
27 #define RGL_DEFAULT_SERVER "10.0.2.2"
29 class ServerConnection {
32 int create(size_t buf_size = 4 * 1024 * 1024, const char *defaultServer = RGL_DEFAULT_SERVER);
33 static gl_client_context_t *s_getGlContext();
34 static ServerConnection *s_getServerConnection();
35 static gl2_client_context_t *s_getGl2Context();
36 GLEncoder *glEncoder() { return m_glEnc; }
37 GL2Encoder *gl2Encoder() { return m_gl2Enc; }
38 ut_rendercontrol_encoder_context_t * utEnc() { return m_ut_enc; }
44 static pthread_key_t s_glKey;
45 static pthread_key_t s_connectionKey;
46 static void s_initKeys();
50 ut_rendercontrol_encoder_context_t *m_ut_enc;