arduino-audio-tools
Loading...
Searching...
No Matches
OutputTFT_eSPI.h
Go to the documentation of this file.
1#pragma once
2#include <TFT_eSPI.h> // https://github.com/Bodmer/TFT_eSPI
3
5
6namespace audio_tools {
7
18 public:
19 OutputTFT_eSPI(TFT_eSPI& tft) : tft_(tft) {}
20
21 bool begin() {
22 tft_.init();
23 tft_.setRotation(1);
24 tft_.fillScreen(TFT_BLACK);
25 return true;
26 }
27
30 p_info = &source;
31 }
32
35 info_ = info;
36 }
37
38 size_t write(const uint8_t* data, size_t len) override {
39 if (p_info != nullptr) {
41 }
42 if (info_.width == 0 || info_.height == 0) {
43 LOGE("OutputTFT: invalid video size: %d x %d", (int)info_.width,
44 (int)info_.height);
45 return 0;
46 }
47 tft_.pushImage(0, 0, info_.width, info_.height, (uint16_t*)data);
48 return len;
49 }
50
51 protected:
52 TFT_eSPI& tft_;
55};
56
57} // namespace audio_tools
#define LOGE(...)
Definition AudioLoggerIDF.h:30
Bridges VideoDecoder's write() calls to the TFT - VideoDecoder always hands over one complete frame p...
Definition OutputTFT_eSPI.h:17
VideoInfoSource * p_info
Definition OutputTFT_eSPI.h:53
VideoInfo info_
Definition OutputTFT_eSPI.h:54
bool begin()
Definition OutputTFT_eSPI.h:21
size_t write(const uint8_t *data, size_t len) override
Definition OutputTFT_eSPI.h:38
OutputTFT_eSPI(TFT_eSPI &tft)
Definition OutputTFT_eSPI.h:19
void setVideoInfoSource(VideoInfoSource &source)
Defines the source of the video information (width, height, fps, format)
Definition OutputTFT_eSPI.h:29
TFT_eSPI & tft_
Definition OutputTFT_eSPI.h:52
void setVideoInfo(VideoInfo info)
Defines the video format and dimensions - call before begin() if you.
Definition OutputTFT_eSPI.h:34
Definition Video.h:176
virtual VideoInfo videoInfo()=0
Abstract class for video playback. This class is used to assemble a complete video frame in memory....
Definition Video.h:192
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition LMSEchoCancellationStream.h:6
Basic video information (width/height/codec/frame size), analogous to AudioInfo - common to both Demu...
Definition Video.h:102
uint16_t height
Frame height in pixels.
Definition Video.h:106
uint16_t width
Frame width in pixels.
Definition Video.h:104