equal
deleted
inserted
replaced
57 { |
57 { |
58 case '?': |
58 case '?': |
59 SendIPC("!"); |
59 SendIPC("!"); |
60 break; |
60 break; |
61 case 'p': |
61 case 'p': |
62 emit onProgress(float(++curFrame)/numFrames); |
62 emit onProgress((quint8(msg.at(2))*256.0 + quint8(msg.at(3)))*0.0001); |
63 break; |
63 break; |
64 case 'v': |
64 case 'v': |
65 finished = true; |
65 finished = true; |
66 break; |
66 break; |
67 } |
67 } |
68 } |
68 } |
69 } |
69 } |
70 |
70 |
71 void HWRecorder::EncodeVideo(const QByteArray & record, int numFrames) |
71 void HWRecorder::EncodeVideo(const QByteArray & record) |
72 { |
72 { |
73 this->numFrames = numFrames; |
|
74 curFrame = 0; |
|
75 |
|
76 toSendBuf = record; |
73 toSendBuf = record; |
77 toSendBuf.replace(QByteArray("\x02TD"), QByteArray("\x02TV")); |
74 toSendBuf.replace(QByteArray("\x02TD"), QByteArray("\x02TV")); |
78 toSendBuf.replace(QByteArray("\x02TL"), QByteArray("\x02TV")); |
75 toSendBuf.replace(QByteArray("\x02TL"), QByteArray("\x02TV")); |
79 toSendBuf.replace(QByteArray("\x02TN"), QByteArray("\x02TV")); |
76 toSendBuf.replace(QByteArray("\x02TN"), QByteArray("\x02TV")); |
80 toSendBuf.replace(QByteArray("\x02TS"), QByteArray("\x02TV")); |
77 toSendBuf.replace(QByteArray("\x02TS"), QByteArray("\x02TV")); |
102 arguments << (config->isAltDamageEnabled() ? "1" : "0"); |
99 arguments << (config->isAltDamageEnabled() ? "1" : "0"); |
103 arguments << config->netNick().toUtf8().toBase64(); |
100 arguments << config->netNick().toUtf8().toBase64(); |
104 arguments << QString::number(config->translateQuality()); |
101 arguments << QString::number(config->translateQuality()); |
105 arguments << QString::number(config->stereoMode()); |
102 arguments << QString::number(config->stereoMode()); |
106 arguments << HWGame::tr("en.txt"); |
103 arguments << HWGame::tr("en.txt"); |
107 arguments << QString::number(config->rec_Framerate()); // framerate num |
104 arguments << QString::number(config->rec_Framerate()); // framerate numerator |
108 arguments << "1"; // framerate den |
105 arguments << "1"; // framerate denominator |
109 arguments << prefix; |
106 arguments << prefix; |
110 arguments << config->AVFormat(); |
107 arguments << config->AVFormat(); |
111 arguments << config->videoCodec(); |
108 arguments << config->videoCodec(); |
112 arguments << "5"; // video quality |
109 arguments << "5"; // video quality |
113 arguments << "medium"; |
|
114 arguments << (config->recordAudio()? config->audioCodec() : "no"); |
110 arguments << (config->recordAudio()? config->audioCodec() : "no"); |
115 arguments << "5"; // audio quality |
|
116 |
111 |
117 return arguments; |
112 return arguments; |
118 } |
113 } |