1 // Copyright (C) 2022 Beken Corporation
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include <os/os.h>
16 #include <components/log.h>
17
18 #include "media_core.h"
19 #include "media_evt.h"
20 #include "frame_buffer.h"
21
22 #include <driver/int.h>
23 #include <os/mem.h>
24 #include <driver/gpio.h>
25 #include <driver/gpio_types.h>
26
27 #include <driver/dma.h>
28
29
30 #define TAG "comm"
31
32 #define LOGI(...) BK_LOGI(TAG, ##__VA_ARGS__)
33 #define LOGW(...) BK_LOGW(TAG, ##__VA_ARGS__)
34 #define LOGE(...) BK_LOGE(TAG, ##__VA_ARGS__)
35 #define LOGD(...) BK_LOGD(TAG, ##__VA_ARGS__)
36
37
comm_event_handle(uint32_t event,uint32_t param)38 void comm_event_handle(uint32_t event, uint32_t param)
39 {
40 switch (event)
41 {
42 case EVENT_COM_FRAME_WIFI_FREE_IND:
43 frame_buffer_free_request((frame_buffer_t *)param, MODULE_WIFI);
44 break;
45 case EVENT_COM_FRAME_DECODER_FREE_IND:
46 frame_buffer_free_request((frame_buffer_t *)param, MODULE_DECODER);
47 break;
48 case EVENT_COM_FRAME_CAPTURE_FREE_IND:
49 frame_buffer_free_request((frame_buffer_t *)param, MODULE_CAPTURE);
50 break;
51 }
52 }
53
54
55